mirror of
https://github.com/bretzel-app/crumbs.git
synced 2026-10-12 20:06:57 +02:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user