fix(editor): e2e setup retries a GoTrue 500 step-up, drops late replays

This commit is contained in:
bchanot committed 2026-11-14 19:01:21 +01:00
1 parent dca80cb006
commit 0ea94602d1
5 files changed
+110 -11

No files matched your search

@@ -1,7 +1,9 @@
import { fr } from '@/i18n/fr'
import type { Page, TestInfo } from '@playwright/test'
import { expect, test } from '../support/browser'
import { sessionAal, stepUpAdmin } from '../support/admin'
import { dropLateReplays, routeToSandbox } from '../support/sandbox'
import { signIn } from '../support/shell'
import {
TABS,
closeFinding,
@@ -284,4 +286,27 @@ test.describe('editor shell journeys (H)', () => {
.replace('{revision}', String(seed.revision + 1))
await expect(saveLine(page)).toHaveText(new RegExp(`^${timed}$`))
})
test('the step-up of the setup survives one GoTrue verify failure (verifier 10)', async ({
page,
}) => {
// Under the eight-worker sweep GoTrue answered a verify HTTP 500 (gate final.log):
// the step-up shows « indisponible » and the setup must try again, never stop there.
const actor = await editorActor('fr')
let failed = false
await page.route('**/auth/v1/factors/*/verify', (route) => {
if (failed) return route.fallback()
failed = true
return route.fulfill({
status: 500,
contentType: 'application/json',
body: JSON.stringify({ code: 500, error_code: 'unexpected_failure' }),
})
})
await signIn(page, actor.account, dict)
await page.goto('/app/admin')
await stepUpAdmin(page, dict, actor.secret)
expect(failed).toBe(true)
expect(await sessionAal(page)).toBe('aal2')
})
})