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:
Naiyuan Qing
2026-07-08 19:53:21 +08:00
parent 47fc21718e
commit 7fce7af590

View File

@@ -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";