Merge pull request 'fix: networkidle still used in stake.ts login flow (#501)' (#508) from fix/issue-501 into master

This commit is contained in:
johba 2026-03-06 17:46:13 +01:00
commit 70f3336024

View file

@ -35,9 +35,11 @@ async function navigateToStakePage(page: Page): Promise<void> {
console.log('[stake] Password prompt detected, entering lobsterDao...');
await page.getByLabel('Password').fill('lobsterDao');
await page.getByRole('button', { name: 'Login' }).click();
// router.push('/') in LoginView → '/' redirects to '/stake' → stake page loads.
// Allow extra time for the two-hop client-side navigation to settle in slow CI.
await page.waitForLoadState('networkidle', { timeout: 20_000 });
// router.push('/') in LoginView → '/' redirects to '/app/stake' → stake page loads.
// waitForLoadState('networkidle') is avoided here for the same reason as navigate.ts:
// persistent WebSocket connections prevent the network from ever going idle.
// Instead, wait for the URL to settle on the stake page as the readiness signal.
await page.waitForURL('**/app/stake**', { timeout: 20_000 });
console.log('[stake] Authenticated, stake page loading');
}
}