diff --git a/website/src/__tests__/public-auth-pages.test.tsx b/website/src/__tests__/public-auth-pages.test.tsx index cb5b8c4..6d2afec 100644 --- a/website/src/__tests__/public-auth-pages.test.tsx +++ b/website/src/__tests__/public-auth-pages.test.tsx @@ -12,6 +12,7 @@ const mockGetSuperTokensAuthRuntimeValidation = vi.fn() const mockIsGitHubOAuthEnabled = vi.fn(() => false) const mockIsGoogleOAuthEnabled = vi.fn(() => false) const mockIsOrcidOAuthEnabled = vi.fn(() => false) +const mockGetAuthHealth = vi.fn() const mockGetReleaseManifest = vi.fn() vi.mock('../auth/platform-auth', () => ({ @@ -19,6 +20,7 @@ vi.mock('../auth/platform-auth', () => ({ })) vi.mock('../auth/auth-api', () => ({ + getAuthHealth: (...args: unknown[]) => mockGetAuthHealth(...args), getReleaseManifest: (...args: unknown[]) => mockGetReleaseManifest(...args), })) @@ -108,6 +110,7 @@ describe('public auth and download pages', () => { mockIsGitHubOAuthEnabled.mockReset() mockIsGoogleOAuthEnabled.mockReset() mockIsOrcidOAuthEnabled.mockReset() + mockGetAuthHealth.mockReset() mockGetReleaseManifest.mockReset() mockGetSuperTokensAuthRuntimeValidation.mockReturnValue({ ready: true, @@ -122,6 +125,42 @@ describe('public auth and download pages', () => { login: (...args: unknown[]) => mockLogin(...args), register: (...args: unknown[]) => mockRegister(...args), }) + mockGetAuthHealth.mockResolvedValue({ + ok: true, + service: 'hypertwist-auth-server', + supertokens: { + configured: true, + reachable: true, + ready: true, + apiVersion: '5.4', + error: null, + oauth: { + github: false, + google: false, + }, + }, + fallback: { + enabled: true, + active: false, + reason: null, + }, + billing: { + statePath: '/var/lib/hypertwist/auth/hypertwist-billing-state.json', + processedEventCount: 0, + pricePlanMapConfigured: false, + productPlanMapConfigured: false, + webhookSecretConfigured: false, + }, + runtime: { + mode: 'mixed', + public_origin_ready: true, + cookie_secure: true, + api_domain: 'https://hypertwist.app', + website_domain: 'https://hypertwist.app', + warnings: [], + errors: [], + }, + }) mockGetReleaseManifest.mockResolvedValue({ ok: true, manifest: {