Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions web/src/pages/Home.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@
<option value="updated">Updated</option>
<option value="name">Name</option>
<option value="traffic">Traffic</option>
<option value="view_uniques">Unique visitors</option>
<option value="clones">Clones</option>
<option value="clone_uniques">Unique cloners</option>
</select>
<select id="sort-order" aria-label="Sort order" bind:value={sortOrder}>
<option value="desc">Desc</option>
Expand Down
17 changes: 17 additions & 0 deletions web/src/pages/Home.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Loading