mirror of
https://github.com/saltbo/zpan.git
synced 2026-08-29 00:01:42 +08:00
test(e2e): retry admin nav so post-sign-in redirect can't interrupt it
signInAsAdmin waited for the /files redirect then immediately goto'd
/admin/storages, but the client redirect to /files could still be in
flight and interrupt the navigation ("interrupted by another navigation
to /files"), flaking responsive-admin. Wrap the goto + URL assertion in
expect(...).toPass() so it re-navigates until /admin/storages commits.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+6
-2
@@ -51,8 +51,12 @@ export async function signInAsAdmin(page: Page) {
|
||||
])
|
||||
expect(resp.status()).toBe(200)
|
||||
await expect(page).toHaveURL(/files/, { timeout: 10000 })
|
||||
await page.goto('/admin/storages')
|
||||
await expect(page).toHaveURL(/admin\/storages/, { timeout: 10000 })
|
||||
// The post-sign-in client redirect to /files can still be in flight and
|
||||
// interrupt this navigation; retry the goto until /admin/storages commits.
|
||||
await expect(async () => {
|
||||
await page.goto('/admin/storages')
|
||||
await expect(page).toHaveURL(/admin\/storages/, { timeout: 5000 })
|
||||
}).toPass({ timeout: 15000 })
|
||||
}
|
||||
|
||||
export async function expandSignUpForm(page: Page) {
|
||||
|
||||
Reference in New Issue
Block a user