RuleTemplate seed and create flow

This commit is contained in:
adilallo
2026-04-10 22:17:52 -06:00
parent cee81eda16
commit ec5afd1464
47 changed files with 1706 additions and 265 deletions
+20
View File
@@ -0,0 +1,20 @@
import { vi } from "vitest";
/**
* Shared Next.js navigation mock for tests that render components using useRouter
* (e.g. home RuleStack) without a file-local vi.mock.
*/
export const testRouter = {
push: vi.fn(),
replace: vi.fn(),
back: vi.fn(),
prefetch: vi.fn(),
};
export const testPathname = vi.fn(() => "/");
vi.mock("next/navigation", () => ({
useRouter: () => testRouter,
usePathname: () => testPathname(),
useSearchParams: vi.fn(() => new URLSearchParams()),
}));