Skip to content

Commit 6410a3f

Browse files
committed
test(mobile): isolate thread list connection subscriptions
1 parent 1ae0dab commit 6410a3f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎apps/mobile/src/features/threads/useThreadListV2.test.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { Atom, AtomRegistry } from "effect/reactivity";
99
import { expect, it, vi } from "vite-plus/test";
1010

1111
import { olderSettledThreads } from "../../state/threads";
12+
import { workspaceConnections } from "../../state/workspace";
1213
import { makeRawThreadShell } from "../../test-fixtures";
1314
import { useThreadListV2 } from "./useThreadListV2";
1415

@@ -17,9 +18,14 @@ vi.mock("../../state/threads", () => ({
1718
threadFamilies: { mountRows: () => () => {} },
1819
}));
1920
vi.mock("../../state/atom-registry", () => ({ appAtomRegistry: undefined }));
21+
vi.mock("../../state/workspace", () => ({
22+
workspaceConnections: { environmentsAtom: vi.fn() },
23+
}));
24+
vi.mock("../../state/shell", () => ({ environmentShell: { statusAtom: vi.fn() } }));
2025

2126
it("reuses a large thread list across tab renders and updates when its inputs change", async () => {
2227
vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true);
28+
vi.mocked(workspaceConnections).environmentsAtom = Atom.make([]);
2329
using _globals = { [Symbol.dispose]: () => vi.unstubAllGlobals() };
2430
const shelfAtom = Atom.make<ReadonlyMap<EnvironmentId, OlderSettledShelfEnvironment>>(new Map());
2531
vi.mocked(olderSettledThreads.shelfAtom).mockReturnValue(shelfAtom);

0 commit comments

Comments
 (0)