test(ui): add getCookie to cookieUtils mock in user_dashboard test

user_dashboard.tsx imports getCookie from @/utils/cookieUtils, but the
vi.mock factory in user_dashboard.test.tsx only exports clearTokenCookies.
Vitest throws `No "getCookie" export is defined on the "@/utils/cookieUtils"
mock`, breaking all three beforeunload-listener tests.

Add getCookie to the mock factory so it matches the current imports.
This commit is contained in:
Ryan Crabbe 2026-04-14 15:18:10 -07:00
parent 43efe76f17
commit bdaaa5c187
No known key found for this signature in database

View File

@ -45,6 +45,7 @@ vi.mock("jwt-decode", () => ({
// Mock cookie utility
vi.mock("@/utils/cookieUtils", () => ({
clearTokenCookies: vi.fn(),
getCookie: vi.fn().mockReturnValue("fake-jwt-token"),
}));
// Mock fetchTeams