Skip to content

Commit db0e0c9

Browse files
nandastoneclaude
andcommitted
test(web): palette focus test mocks the thread menu's dependencies
The palette now builds thread menu items through useThreadActionMenu, so the focus test's mocks need useNewThreadHandler and useRouter, and an activeThread of null to match the real hook's type. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 966db3e commit db0e0c9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎apps/web/src/components/CommandPalette.focus.browser.test.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ vi.mock("@tanstack/react-router", () => ({
1111
useNavigate: () => vi.fn(),
1212
useParams: () => null,
1313
useLocation: () => "/settings",
14+
useRouter: () => ({ navigate: vi.fn() }),
1415
}));
1516
vi.mock("@effect/atom-react", async (importOriginal) => {
1617
const original = await importOriginal<typeof import("@effect/atom-react")>();
@@ -33,7 +34,10 @@ vi.mock("../hooks/useScratchProject", () => ({
3334
useScratchProject: () => ({ scratchEnvironmentId: () => null }),
3435
}));
3536
vi.mock("../hooks/useNewProject", () => ({ useNewProject: () => vi.fn() }));
36-
vi.mock("../hooks/useHandleNewThread", () => ({ useHandleNewThread: () => ({}) }));
37+
vi.mock("../hooks/useHandleNewThread", () => ({
38+
useHandleNewThread: () => ({ activeThread: null }),
39+
useNewThreadHandler: () => vi.fn(),
40+
}));
3741
vi.mock("../hooks/useOpenPanelPullRequestUrl", () => ({ useOpenPanelPullRequestUrl: () => null }));
3842
vi.mock("../connection/useDesktopLocalBootstraps", () => ({ useDesktopLocalBootstraps: () => [] }));
3943
vi.mock("../state/use-atom-command", () => ({ useAtomCommand: () => vi.fn() }));

0 commit comments

Comments
 (0)