Commit graph

9 commits

Author SHA1 Message Date
Johannes Millan
755cd705f5
Fix/run 22683814946 (#6740)
test(e2e): fix e2e tests
2026-03-05 19:37:48 +01:00
Johannes Millan
baa9a46935 test(sync): add encryption and supersync e2e test coverage
Add comprehensive test coverage for the encryption and SuperSync features:

- Add e2e tests for encryption prompt loop, error scenarios, no-op sync
- Add e2e tests for provider switch, re-enable, account reset, server migration
- Add e2e tests for import clean-slate scenario
- Add unit tests for encryption dialogs, toggle, enable/disable services
- Add unit tests for sync-config, sync-wrapper, file-based-encryption
- Add unit tests for operation-log-sync, sync-import-filter, clean-slate
- Update supersync page object for mandatory encryption flows
2026-03-01 21:27:08 +01:00
Johannes Millan
fda5bca5b3 test(e2e): fix flaky import-sync tests with proper app readiness waits
Replace waitForLoadState('networkidle') with waitForAppReady() after
post-import page reloads and before task count verification. networkidle
only waits for network silence but not Angular bootstrap, loading
screens, or blocking dialogs - causing intermittent failures under load.
2026-02-13 14:06:43 +01:00
Johannes Millan
fc7c8e517c test(e2e): reduce supersync test flakiness
- Replace page.reload() with page.goto() pattern throughout sync tests
  (service workers cause reload timeouts)
- Add handling for "Encryption Settings Will Change" dialog in import tests
- Add page reload after sync to ensure archive data is loaded in worklog test
- Add skipSpinnerCheck option for cases where sync may have already completed
- Improve waits and selectors in error-handling tests for better stability
- Make snackbar visibility check non-blocking in wrong-password test

Reduces flaky tests from 6 to 1 in supersync test suite.
2026-01-26 13:48:10 +01:00
Johannes Millan
661e72691a test(e2e): fix failing supersync e2e tests
- Fix import-sync merge test: use goto instead of reload for reliability
  with service workers
- Fix tag management test: add proper menu close handling with multiple
  Escape presses and fallback click to dismiss overlays
- Fix encryption enable/disable tests: use fresh client contexts instead
  of reconfiguring existing clients to avoid clean slate conflicts
- Fix encryption password change tests: correct wait states and method
  names
- Add encryption password field to SuperSync form with e2e class selector
2026-01-25 12:49:21 +01:00
Johannes Millan
1520fdf0a3 fix(sync): prevent SYNC_IMPORT filtering concurrent ops in file-based sync
Problem: When a new client (C) joined via file-based sync (Dropbox/WebDAV/
LocalFile), it created a SYNC_IMPORT operation with "clean slate" semantics.
Tasks created by other clients (B) after C joined but before syncing had
vector clocks CONCURRENT with C's SYNC_IMPORT, causing them to be filtered
by SyncImportFilterService - resulting in data loss.

Solution:
- Add `createSyncImportOp` parameter to `hydrateFromRemoteSync()` (default true)
- File-based sync bootstrap passes `false`, skipping SYNC_IMPORT creation
  while still updating vector clock, saving state cache, and dispatching loadAllData
- Add confirmation dialog when clients with unsynced local ops receive a snapshot
- Add comprehensive E2E tests for concurrent task creation after late join

The fix preserves SYNC_IMPORT for explicit "use local/remote" conflict resolution
while preventing the bug in file-based sync bootstrap flows.

Test coverage:
- 30 unit tests for sync-hydration.service (createSyncImportOp scenarios)
- 5 E2E tests in webdav-provider-switch.spec.ts:
  - "should sync tasks when Client B connects to existing WebDAV server"
  - "should sync concurrent tasks created after late join (CRITICAL BUG FIX)"
  - "should sync three clients with late joiner (original bug report scenario)"
  - "should handle bidirectional sync after provider switch"
  - "should replace multiple local ops when user accepts confirmation"
2026-01-07 20:39:13 +01:00
Johannes Millan
c757ff500d test(sync): re-enable sync after import in tests and adjust baseURL fallback 2025-12-22 12:08:04 +01:00
Johannes Millan
0b998459aa fix(e2e): fix failing tags test and flaky late-join test
- Tags test: Use right-click context menu approach instead of 'g' shortcut
  to avoid typing into editable task title
- Tags test: Add robust dismissAllOverlays helper with multiple Escape
  presses and backdrop click fallback
- Late-join test: Improve conflict dialog handling with retry loop and
  wait for dialog to close
- Late-join test: Add extra sync cycle after conflict resolution for
  more reliable data propagation
- All files: Fix incorrect port in warning messages (1900 -> 1901)

All 48 supersync e2e tests pass consistently.
2025-12-17 21:56:53 +01:00
Johannes Millan
a7a831c2f1 test(sync): add integration and E2E tests for import, repair, provider switch
- Add E2E tests for import backup file + sync to second client
- Add integration tests for SyncImport/BackupImport operation creation
- Add integration tests for REPAIR operation sync propagation
- Add integration tests for provider switch data preservation
- Add test backup fixture with active/archived tasks
- Add import page object for E2E tests
2025-12-12 20:47:48 +01:00