fix(ui): mock project router in keys tests

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
jesus 2026-10-10 21:27:51 +00:00
parent e50d78760b
commit a4538e5454

View file

@ -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),