The best way to control Claude Code, Codex and more from any computer or phone
test(web): command palette tests clear a leaked last-used project (#35107)
Julius Marminge committed
Nov 12, 2026 at 02:39 UTC
5fae2b5124d8c491f242c004a6c6ef8602517719
1 file changed
+5
apps/web/src/components/CommandPalette.browser.test.tsx
+5
@@ -5,6 +5,8 @@ import { page, userEvent } from "vite-plus/test/browser";
5
import { act, render } from "../../test/render";
6
import { openCommandPalette } from "../commandPaletteBus";
7
import { useCommandPaletteStore } from "../commandPaletteStore";
8
+import { LAST_USED_PROJECT_STORAGE_KEY } from "../hooks/useHandleNewThread";
9
+import { removeLocalStorageItem } from "../hooks/useLocalStorage";
10
import { makeThreadFixture } from "../test-fixtures";
11
import type { Project, Thread } from "../types";
12
import { CommandPalette } from "./CommandPalette";
@@ -20,6 +22,9 @@ vi.mock("../state/entities", async (original) => ({
22
}));
23
24
function setup(state: { projects?: ReadonlyArray<Project>; threads?: ReadonlyArray<Thread> } = {}) {
25
+ // Earlier browser test files share this origin's localStorage; a remembered project
26
+ // that is not listed here hides the default "New thread in <project>" row.
27
+ removeLocalStorageItem(LAST_USED_PROJECT_STORAGE_KEY);
28
useCommandPaletteStore.setState(useCommandPaletteStore.getInitialState(), true);
29
entities.projects = state.projects ?? [];
30
entities.threads = state.threads ?? [];