diff --git a/src/components/insights/__tests__/recommendation-card-confidence.test.tsx b/src/components/insights/__tests__/recommendation-card-confidence.test.tsx index ad27d0ae0..8c16dd7f3 100644 --- a/src/components/insights/__tests__/recommendation-card-confidence.test.tsx +++ b/src/components/insights/__tests__/recommendation-card-confidence.test.tsx @@ -11,6 +11,29 @@ vi.mock("@/components/charts/mood-chart", () => ({ MoodChart: () =>
, })); +// B5e wired RecommendationFeedback into the rec card; that component +// pulls in useAuth + useMutation from tanstack-query, both of which +// need stubbing for SSR rendering in tests. +vi.mock("@tanstack/react-query", () => ({ + useQuery: () => ({ data: null, isLoading: false }), + useMutation: () => ({ + mutate: vi.fn(), + isPending: false, + isSuccess: false, + isError: false, + error: null, + }), + useQueryClient: () => ({ invalidateQueries: vi.fn() }), +})); + +vi.mock("@/hooks/use-auth", () => ({ + useAuth: () => ({ + user: { id: "test-user", username: "tester", role: "USER" }, + isAuthenticated: true, + isLoading: false, + }), +})); + /** * v1.4.16 phase B5d — confidence meter wiring inside * `