Skip to content

Commit 6a2b578

Browse files
BunsDevclaude
andcommitted
fix(test): add router and query client mocks to WorkspaceFileTree test
The test was missing mocks for useParams (tanstack router) and useQueryClient after WorkspaceFileTree gained useFileViewNavigation and a delete-entry callback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c9ae3bf commit 6a2b578

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

apps/web/src/components/WorkspaceFileTree.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ vi.mock("@tanstack/react-query", async (importOriginal) => {
77
return {
88
...actual,
99
useQuery: vi.fn(),
10+
useQueryClient: () => ({ invalidateQueries: vi.fn() }),
1011
};
1112
});
1213

14+
vi.mock("@tanstack/react-router", () => ({
15+
useNavigate: () => vi.fn(),
16+
useParams: () => null,
17+
}));
18+
1319
const useQueryMock = vi.mocked(useQuery);
1420

1521
describe("WorkspaceFileTree", () => {

0 commit comments

Comments
 (0)