diff --git a/web/src/pages/Home.svelte b/web/src/pages/Home.svelte index c9a72fe..784aab7 100644 --- a/web/src/pages/Home.svelte +++ b/web/src/pages/Home.svelte @@ -210,7 +210,9 @@ Updated Name Traffic + Unique visitors Clones + Unique cloners Desc diff --git a/web/src/pages/Home.test.js b/web/src/pages/Home.test.js index c5bd855..ba1da8a 100644 --- a/web/src/pages/Home.test.js +++ b/web/src/pages/Home.test.js @@ -30,6 +30,23 @@ describe("Home", () => { expect(screen.getByRole("link", { name: "hello-world" })).toBeInTheDocument(); }); + test("offers unique sorts in the quick dropdown", () => { + render(Home, { + props: { + populated: true, + lookup: "octocat", + profile: { login: "octocat", name: "The Octocat", html_url: "https://github.com/octocat", avatar_url: "https://example.com/a.png", public_repos: 1, followers: 1, following: 1 }, + orgs: [], + source: { type: "user", login: "octocat" }, + repos: [{ name: "hello-world", html_url: "https://github.com/octocat/hello-world", stargazers_count: 10, forks_count: 2, language: "Go", description: "demo", updated_at: "2026-08-01T00:00:00Z", traffic: { available: true } }], + error: "", + }, + }); + const sortSelect = screen.getByLabelText("Sort by"); + expect(within(sortSelect).getByRole("option", { name: "Unique visitors" })).toBeInTheDocument(); + expect(within(sortSelect).getByRole("option", { name: "Unique cloners" })).toBeInTheDocument(); + }); + test("opens a complete sort dialog with traffic fields", async () => { render(Home, { props: {