Add some auth tests

This commit is contained in:
shamoon
2026-02-04 20:58:22 -08:00
parent e0b66c398f
commit ab869f042a
3 changed files with 178 additions and 0 deletions

View File

@@ -8,6 +8,12 @@ afterEach(() => {
if (typeof document !== "undefined") cleanup();
});
// Avoid NextAuth client-side fetches during unit tests.
vi.mock("next-auth/react", () => ({
SessionProvider: ({ children }) => children ?? null,
getProviders: vi.fn(async () => ({})),
}));
// implement a couple of common formatters mocked in next-i18next
vi.mock("next-i18next", () => ({
// Keep app/page components importable in unit tests.