From bdaaa5c187255c2f0cfc7ff53f01407f9070c20b Mon Sep 17 00:00:00 2001 From: Ryan Crabbe Date: Tue, 14 Apr 2026 15:18:10 -0700 Subject: [PATCH] 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. --- ui/litellm-dashboard/src/components/user_dashboard.test.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/litellm-dashboard/src/components/user_dashboard.test.tsx b/ui/litellm-dashboard/src/components/user_dashboard.test.tsx index d21369eed3..4d4213b680 100644 --- a/ui/litellm-dashboard/src/components/user_dashboard.test.tsx +++ b/ui/litellm-dashboard/src/components/user_dashboard.test.tsx @@ -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