diff --git a/internal/api/handlers/v0/ui_index.html b/internal/api/handlers/v0/ui_index.html index dc437ff76..88ed79ba0 100644 --- a/internal/api/handlers/v0/ui_index.html +++ b/internal/api/handlers/v0/ui_index.html @@ -24,14 +24,6 @@

Official MCP Registry

- - -
@@ -50,6 +42,14 @@

Recently Updated

+ + +
Loading servers... diff --git a/internal/api/handlers/v0/ui_test.go b/internal/api/handlers/v0/ui_test.go new file mode 100644 index 000000000..c9e8c6a52 --- /dev/null +++ b/internal/api/handlers/v0/ui_test.go @@ -0,0 +1,23 @@ +package v0_test + +import ( + "strings" + "testing" + + v0 "github.com/modelcontextprotocol/registry/internal/api/handlers/v0" + "github.com/stretchr/testify/require" +) + +func TestUIHTML_SearchPrecedesRecentlyUpdated(t *testing.T) { + html := v0.GetUIHTML() + + searchPos := strings.Index(html, `id="search"`) + latestOnlyPos := strings.Index(html, `id="latest-only"`) + recentPos := strings.Index(html, `id="recently-updated"`) + + require.NotEqual(t, -1, searchPos, "id=\"search\" must be present in UI HTML") + require.NotEqual(t, -1, latestOnlyPos, "id=\"latest-only\" must be present in UI HTML") + require.NotEqual(t, -1, recentPos, "id=\"recently-updated\" must be present in UI HTML") + require.Less(t, searchPos, recentPos, "search control must appear before recently-updated section") + require.Less(t, latestOnlyPos, recentPos, "filter control must appear before recently-updated section") +}