perf(webui): make marketplace filters instant

This commit is contained in:
Xubin Ren
2026-07-30 01:13:37 +08:00
parent 12ebc7b8e2
commit d276fe1386
2 changed files with 35 additions and 9 deletions
+12
View File
@@ -717,6 +717,18 @@ describe("App layout", () => {
expect(screen.getAllByText("SkillHub")).toHaveLength(2);
expect(screen.getAllByText("skills.sh")).toHaveLength(2);
expect(screen.getByText(/14,481 installs \/ 24h/)).toBeInTheDocument();
fireEvent.click(screen.getByRole("tab", { name: "SkillHub" }));
expect(screen.getByText("ima-skills")).toBeInTheDocument();
expect(screen.queryByText("find-skills")).not.toBeInTheDocument();
expect(
vi.mocked(fetch).mock.calls.some(
([input]) =>
String(input) === "/api/webui/skills/trending?provider=skillhub",
),
).toBe(false);
fireEvent.click(screen.getByRole("tab", { name: "All" }));
expect(screen.getByText("find-skills")).toBeInTheDocument();
expect(screen.getByText("ima-skills")).toBeInTheDocument();
expect(
await screen.findByRole("img", { name: "8-week install trend" }),
).toBeInTheDocument();