trails/openspec/changes/e2e-test-reorganization/proposal.md
Ullrich Schäfer a44beb87ef
Update route-coloring spec with all 10 modes, create follow-up changes
Spec updates:
- route-coloring: Added speed limit, smoothness, track type, cycleway,
  and bike route modes. Added OSM wiki links, BRouter profile patching,
  dropdown order, bike route human-readable legends.

New follow-up changes (proposals only):
- elevation-map-interaction: Bidirectional chart ↔ map interaction
  (route hover → chart, chart click → pan, chart drag → zoom)
- e2e-test-reorganization: Mock BRouter by default, split tests by
  feature, shared helpers
- journal-poi-details: Surface POI metadata in Journal route detail
  (phone, address, website, opening hours from snapped waypoints)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 11:20:17 +02:00

21 lines
1.2 KiB
Markdown

## Why
The planner E2E test file (`e2e/planner.test.ts`) has grown to 42+ tests in a single describe block. Tests that need a computed route manually call `mockBRouter(page)` — this is opt-in and easy to forget, leading to flaky tests when BRouter is slow. Test setup is duplicated across tests (create session, goto URL, wait for connected).
## What Changes
- **Mock BRouter by default**: Use a shared Playwright fixture or `beforeEach` that mocks BRouter for all planner tests. Only integration tests that explicitly test the real BRouter pipeline should use the real endpoint.
- **Split by feature**: Break `planner.test.ts` into focused files: `planner-session.test.ts`, `planner-routing.test.ts`, `planner-multiday.test.ts`, `planner-overlays.test.ts`, `planner-coloring.test.ts`
- **Shared test helpers**: Extract common patterns (create session + goto + wait for connected) into a reusable helper
## Capabilities
### Modified Capabilities
- Testing infrastructure only — no user-facing changes
## Impact
- `e2e/planner.test.ts` → split into 5-6 files
- `e2e/fixtures/brouter-mock.ts` → becomes default fixture
- New `e2e/helpers/planner.ts` for shared setup
- `playwright.config.ts` may need testMatch updates