From 8bfaaffba556b3f231479cc49ea1e9647f9829e6 Mon Sep 17 00:00:00 2001 From: ryan-crabbe-berri Date: Sat, 5 Sep 2026 17:57:38 -0700 Subject: [PATCH] test(ui): stub the Virtual Keys dashboard in the expired-token page test --- .../tests/CreateKeyPage.expiredToken.test.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ui/litellm-dashboard/tests/CreateKeyPage.expiredToken.test.tsx b/ui/litellm-dashboard/tests/CreateKeyPage.expiredToken.test.tsx index 211a754dad4..6a4fa2e32c3 100644 --- a/ui/litellm-dashboard/tests/CreateKeyPage.expiredToken.test.tsx +++ b/ui/litellm-dashboard/tests/CreateKeyPage.expiredToken.test.tsx @@ -105,7 +105,7 @@ vi.mock("@/utils/returnUrlUtils", async (importOriginal) => { // Super-light stubs for all heavy components so rendering doesn't explode vi.mock("@/components/navbar", () => ({ default: stub("navbar") })); -vi.mock("@/components/user_dashboard", () => ({ default: stub("user-dashboard") })); +vi.mock("@/app/(dashboard)/api-keys/ApiKeysDashboard", () => ({ default: stub("api-keys-dashboard") })); vi.mock("@/components/templates/model_dashboard", () => ({ default: stub("model-dashboard") })); vi.mock("@/components/teams", () => ({ default: stub("teams") })); vi.mock("@/app/(dashboard)/organizations/_components/organizations", () => ({ @@ -135,7 +135,6 @@ vi.mock("@/app/(dashboard)/tag-management/_components", () => ({ default: stub(" vi.mock("@/app/(dashboard)/vector-stores/_components", () => ({ default: stub("vector-stores") })); vi.mock("@/components/ui_theme_settings", () => ({ default: stub("ui-theme-settings") })); vi.mock("@/components/organisms/create_key_button", () => ({ fetchUserModels: vi.fn() })); -vi.mock("@/components/common_components/fetch_teams", () => ({ fetchTeams: vi.fn() })); vi.mock("@/components/ui/ui-loading-spinner", () => ({ UiLoadingSpinner: stub("spinner"), })); @@ -270,9 +269,9 @@ describe("CreateKeyPage auth behavior", () => { expect(window.location.replace).not.toHaveBeenCalled(); }); - // And the default page content appears (UserDashboard stub; chrome now lives in the layout) + // And the default page content appears (ApiKeysDashboard stub; chrome now lives in the layout) await waitFor(() => { - expect(screen.getByTestId("user-dashboard")).toBeInTheDocument(); + expect(screen.getByTestId("api-keys-dashboard")).toBeInTheDocument(); }); });