mirror of
https://github.com/multica-ai/multica.git
synced 2026-08-02 10:05:41 +02:00
test(desktop): mock useCurrentWorkspace/useQuery for tab-bar space icon
tab-bar.tsx now reads the current workspace and its space list to render a space's own icon on space-scoped tabs, but tab-bar.test.tsx's @multica/core/paths mock didn't export useCurrentWorkspace and nothing mocked useQuery, so every test in the file threw at render time. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -60,6 +60,14 @@ vi.mock("@multica/core/paths", () => ({
|
||||
issues: () => `/${slug}/issues`,
|
||||
}),
|
||||
},
|
||||
useCurrentWorkspace: () => ({ id: "ws-1", slug: "acme" }),
|
||||
}));
|
||||
|
||||
vi.mock("@tanstack/react-query", () => ({
|
||||
useQuery: () => ({ data: [] }),
|
||||
}));
|
||||
vi.mock("@multica/core/spaces/queries", () => ({
|
||||
spaceListOptions: () => ({ queryKey: ["spaces"], queryFn: () => [] }),
|
||||
}));
|
||||
|
||||
import { TabBar } from "./tab-bar";
|
||||
|
||||
Reference in New Issue
Block a user