Skip to content

Live view: systematic test coverage for GPS-driven features #142

Description

@DocGerd

Problem

The Live view has accumulated real functionality — GPS readout with active-leg projection, the ownship marker (#104), live reroute from fix (#115), session-restore interaction (#113), and the AIS overlay incoming (#25) — but its test coverage has not kept pace. Component tests run in jsdom with hand-rolled fix injection, and e2e cannot exercise GPS dynamics at all today, so the features that only manifest while the boat is moving are effectively verified by sailing.

Scope

  • Audit first: map every Live-view behavior (fix acquisition/loss, permission denied, stale fix, active-leg advance as the boat moves, off-route distance, reroute availability + flow, ownship marker follow, wide-vs-narrow layout) to its current test (or gap).
  • E2E with emulated geolocation: Playwright supports context.setGeolocation() + grantPermissions(['geolocation']) — drive deterministic fix sequences in live.spec.ts (or a new spec) and assert readout values, leg advance, and the reroute button lifecycle against them. Keep the repo's e2e determinism rules: no fixed waitForTimeout syncs, gate on state signals with expect.poll.
  • Component/unit: close the audited gaps (degradation states, projection edge cases) with pinned-literal expectations (mutation-check discipline).
  • AIS-state testing stays inside AIS: live online traffic overlay with ownship recognition #25's own plan (mocked stream); this issue covers the GPS-driven rest.

Relation to the simulator

A companion issue proposes a Live-view simulator (synthetic voyage playback) — that is the deeper enabler for manual/exploratory testing and richer e2e scenarios. THIS issue is the coverage work achievable with existing tooling (Playwright geolocation emulation + jsdom); the two are complementary, not duplicates.

Related: #104, #113, #115, #25.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UXvHWVP7iALk2rScg3CtkT

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions