From a4538e545491744db028b2175e71790d8ab786c2 Mon Sep 17 00:00:00 2001 From: jesus Date: Sat, 10 Oct 2026 21:27:51 +0000 Subject: [PATCH] fix(ui): mock project router in keys tests Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- ...tion.test.tsx => ProjectKeysSection.integration.test.tsx} | 5 +++++ 1 file changed, 5 insertions(+) rename ui/litellm-dashboard/src/app/(dashboard)/projects/_components/{ProjectKeysSection.test.tsx => ProjectKeysSection.integration.test.tsx} (98%) diff --git a/ui/litellm-dashboard/src/app/(dashboard)/projects/_components/ProjectKeysSection.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/projects/_components/ProjectKeysSection.integration.test.tsx similarity index 98% rename from ui/litellm-dashboard/src/app/(dashboard)/projects/_components/ProjectKeysSection.test.tsx rename to ui/litellm-dashboard/src/app/(dashboard)/projects/_components/ProjectKeysSection.integration.test.tsx index 382c34abcca..3e9fd4faf3d 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/projects/_components/ProjectKeysSection.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/projects/_components/ProjectKeysSection.integration.test.tsx @@ -4,6 +4,11 @@ import type { OnUrlUpdateFunction } from "nuqs/adapters/testing"; import { fireEvent, renderWithProviders, screen, waitFor } from "../../../../../tests/test-utils"; import { ProjectKeysSection } from "./ProjectKeysSection"; +vi.mock("next/navigation", async () => ({ + ...(await vi.importActual("next/navigation")), + useRouter: () => ({ push: vi.fn() }), +})); + const mockUseKeys = vi.fn(); vi.mock("@/app/(dashboard)/hooks/keys/useKeys", () => ({ useKeys: (...args: unknown[]) => mockUseKeys(...args),