You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `setupGeocodingErrorMock` function in `tests/fixtures/mockRoutes.ts` registered new route handlers after `setupDefaultMocks` had already installed success handlers for the same patterns (`**/geocoding/**` and `**/nominatim.openstreetmap.org/**`).
11
+
12
+
Since Playwright evaluates routes in the order they were added (first wins), the success handlers always won and fulfilled requests before the error handlers could respond. This meant that calling `setupGeocodingErrorMock(page)` in tests still returned success (200) responses instead of the expected error (503) responses.
13
+
14
+
**Affected Tests:**
15
+
-`tests/e2e/alerts/create-alert.spec.ts` - Error Handling suite
16
+
-`should handle search errors gracefully`
17
+
-`should handle map loading errors`
18
+
19
+
**Resolution:**
20
+
Updated all error mock functions in `tests/fixtures/mockRoutes.ts` to call `page.unroute()` before adding new error handlers:
21
+
-`setupNetworkErrorMock`
22
+
-`setupServerErrorMock`
23
+
-`setupInvalidCredentialsMock`
24
+
-`setupGeocodingErrorMock`
25
+
-`setupAlertCreationErrorMock`
26
+
27
+
Each function now properly removes the default success handlers before registering error handlers, ensuring the error routes take precedence.
The `docs/SKIPPED_TESTS_ROADMAP.md` documentation (lines 141-220) still describes the original MSW (Mock Service Worker) Node.js approach that was proposed but not implemented. The actual Phase 1 implementation uses Playwright's native `page.route()` API instead.
0 commit comments