refactor: streamline code formatting and enhance test organization mocks

This commit is contained in:
Abhimanyu Saharan
2026-02-09 23:58:54 +05:30
parent 3326100205
commit d9f560ee0c
4 changed files with 26 additions and 5 deletions

View File

@@ -6,6 +6,18 @@ import ActivityPage from "./page";
import { AuthProvider } from "@/components/providers/AuthProvider";
import { QueryProvider } from "@/components/providers/QueryProvider";
vi.mock("next/navigation", () => ({
usePathname: () => "/activity",
useRouter: () => ({
push: vi.fn(),
replace: vi.fn(),
prefetch: vi.fn(),
back: vi.fn(),
forward: vi.fn(),
refresh: vi.fn(),
}),
}));
vi.mock("next/link", () => {
type LinkProps = React.PropsWithChildren<{
href: string | { pathname?: string };

View File

@@ -6,6 +6,18 @@ import GlobalApprovalsPage from "./page";
import { AuthProvider } from "@/components/providers/AuthProvider";
import { QueryProvider } from "@/components/providers/QueryProvider";
vi.mock("next/navigation", () => ({
usePathname: () => "/approvals",
useRouter: () => ({
push: vi.fn(),
replace: vi.fn(),
prefetch: vi.fn(),
back: vi.fn(),
forward: vi.fn(),
refresh: vi.fn(),
}),
}));
vi.mock("next/link", () => {
type LinkProps = React.PropsWithChildren<{
href: string | { pathname?: string };