Testing

Prev Next

Testing

Testing Approach

The testing model is behavior-first and layered:

  1. Manager tests validate capability invariants and transitions.
  2. Hook tests validate React lifecycle bridge behavior.
  3. Module tests (when added) validate user flows with stable data-testid selectors.

Current Coverage Intent

Manager Layer

Focus areas:

  • valid range updates
  • invalid transition rejection
  • reset/undo behavior
  • playback boundary sync behavior
  • malformed input resilience

Hook Layer

Focus areas:

  • manager setup/teardown lifecycle
  • state projection correctness
  • adapter bridging behavior
  • submission hook state transitions

Module Layer (Planned)

Focus areas:

  • full user interaction stories
  • keyboard and drag interactions
  • submission flow UX states

BDD-Style Capability Scenarios

  1. Given a valid initial range, when the user changes start or end within duration, then the manager state updates and remains valid.
  2. Given an invalid update request, when the manager validates, then the previous valid range is preserved.
  3. Given playback reaches selected end time, when sync is evaluated, then playback pauses and seeks to selected start time.
  4. Given reset has been performed, when undo executes, then the previous range is restored.

Quality Gate

Every invariant change requires:

  • at least one manager-layer test
  • at least one hook-level behavior assertion if React bridge semantics changed

ℹ️ Note
No UI refactor should require manager behavior test rewrites.