mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-07-26 13:54:56 +00:00
CI (https://github.com/paperless-ngx/paperless-ngx/actions/runs/29777331059) failed every e2e test that reloads the document list, with the browser throwing "TypeError: Failed to fetch". Root cause: the e2e harness only starts the Angular dev server (no real backend), and relies entirely on page.routeFromHAR(..., { notFound: 'fallback' }) to mock API responses, falling through to the real network for anything not in a recorded HAR. The new GET /api/documents/filter_selection_data/ request added by this branch fires on every non-search reload() and isn't in any pre-recorded HAR fixture, so it fell through to a real network call with nothing listening on the other end. Added a shared mockFilterSelectionData() helper that stubs an empty response for that endpoint, registered via test.beforeEach() before each affected test's own routeFromHAR() call in every spec file that exercises document-list reload (document-list, dashboard, global-permissions, settings, document-detail). Playwright resolves routes in reverse-registration order, so the later-registered HAR route checks first, calls route.fallback() on a miss, and defers back to this earlier-registered stub instead of hitting the network. Not verified locally (Playwright browser binaries aren't installed in this environment and the user preferred not to install them); relying on CI to confirm. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>