From 7fce7af5905b87bd11083187496c8cf4a04afc94 Mon Sep 17 00:00:00 2001 From: Naiyuan Qing <145280634+NevilleQingNY@users.noreply.github.com> Date: Wed, 8 Jul 2026 19:53:21 +0800 Subject: [PATCH] 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 --- apps/desktop/src/renderer/src/components/tab-bar.test.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/desktop/src/renderer/src/components/tab-bar.test.tsx b/apps/desktop/src/renderer/src/components/tab-bar.test.tsx index f1b59d026c..08a42cf185 100644 --- a/apps/desktop/src/renderer/src/components/tab-bar.test.tsx +++ b/apps/desktop/src/renderer/src/components/tab-bar.test.tsx @@ -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";