mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-17 16:37:43 +00:00
test(e2e): strengthen assertions in supersync E2E tests
- Assert 401 route interception fired in token expiry tests - Assert expected LWW winner in three-client config convergence test - Navigate to root view instead of TODAY for cascade delete orphan check
This commit is contained in:
parent
534f375a54
commit
346eb50bf3
3 changed files with 12 additions and 3 deletions
|
|
@ -162,10 +162,10 @@ test.describe('@supersync Cross-Entity Cascade Delete', () => {
|
|||
// ============ PHASE 5: Verify no orphans ============
|
||||
console.log('[CascadeDelete] Phase 5: Verifying no orphaned tasks');
|
||||
|
||||
// Navigate to a known view on both clients
|
||||
await clientA.page.goto('/#/tag/TODAY/tasks');
|
||||
// Navigate to root view where orphaned tasks would appear
|
||||
await clientA.page.goto('/#/');
|
||||
await clientA.page.waitForLoadState('networkidle');
|
||||
await clientB.page.goto('/#/tag/TODAY/tasks');
|
||||
await clientB.page.goto('/#/');
|
||||
await clientB.page.waitForLoadState('networkidle');
|
||||
|
||||
// Verify project is gone from sidebar on both clients
|
||||
|
|
|
|||
|
|
@ -132,6 +132,9 @@ test.describe('@supersync Global Config Sync Edge Cases', () => {
|
|||
expect(aCeleb).toBe(bCeleb);
|
||||
expect(aCeleb).toBe(cCeleb);
|
||||
|
||||
// Verify the expected LWW winner: C's operation was latest, so celebration should be ON
|
||||
expect(aCeleb).toBe(true);
|
||||
|
||||
console.log('[3Client] ✓ All three clients converged to same state');
|
||||
} finally {
|
||||
if (clientA) await closeClient(clientA);
|
||||
|
|
|
|||
|
|
@ -79,6 +79,9 @@ test.describe('@supersync Token Expiry Recovery', () => {
|
|||
console.log('[TokenExpiry] First sync failed with 401 as expected');
|
||||
}
|
||||
|
||||
// Verify the 401 interception actually fired
|
||||
expect(state.return401).toBe(false);
|
||||
|
||||
// Remove interception
|
||||
await clientA.page.unroute('**/api/sync/ops/**');
|
||||
await clientA.page.waitForTimeout(500);
|
||||
|
|
@ -170,6 +173,9 @@ test.describe('@supersync Token Expiry Recovery', () => {
|
|||
console.log('[TokenExpiry] First download failed with 401 as expected');
|
||||
}
|
||||
|
||||
// Verify the 401 interception actually fired
|
||||
expect(state.return401).toBe(false);
|
||||
|
||||
// Remove interception
|
||||
await clientB.page.unroute('**/api/sync/ops/**');
|
||||
await clientB.page.waitForTimeout(500);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue