fix: resolve race condition in offline sync e2e test

Set up waitForResponse before calling setOffline(false) so the sync
response listener is registered before the online event fires.

https://claude.ai/code/session_014yTnHzjkCJLBcYcPTSLVkE
This commit is contained in:
Claude
2026-03-11 19:53:47 +01:00
committed by Fred Cabassut
parent 5f52864945
commit f951baaba6
+2 -1
View File
@@ -62,8 +62,9 @@ test.describe('Offline Support', () => {
await expect(page.getByText('Survive Reload')).toBeVisible();
// When the network is restored and sync completes
const syncResponse = page.waitForResponse('**/api/sync');
await page.context().setOffline(false);
await page.waitForResponse('**/api/sync');
await syncResponse;
// And the user reloads the page
await page.reload();