Fix shared launch-status test harness

This commit is contained in:
axiomlogicnexus 2026-06-22 08:35:35 +00:00
parent 95ccba35f2
commit 891cd95913

View file

@ -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: {