- AZ-471 CanvasEditor draw + 8-handle resize PASS (FT-P-39 fast + e2e + FT-P-40 8 sub-tests). Three drifts pinned via it.fails(): Ctrl+click multi-select (FT-P-41), Ctrl+wheel zoom-around-cursor (FT-P-42), Ctrl+drag empty-canvas pan (FT-P-43) — all rooted in handleMouseDown's early Ctrl-gate and handleWheel's pan-not-adjusted bug. - AZ-473 PhotoMode 3 ACs all PASS in fast + e2e (FT-P-48 switch filter, FT-P-49 auto-select, FT-P-50 yoloId wire across modes P=0/20/40 — outbound classNum == classId + photoModeOffset). - AZ-478 fast 7 + e2e 2: AC-1 user-visible offline indicator, AC-2 tainted-canvas fallback, AC-3 SSE disconnect banner — all drift today (it.fails fast + test.fail e2e + control PASS for each). Service-worker negative check passes. - AZ-479 AC-1 (bundle <= 2 MB gzipped) promoted from on-demand perf script to per-commit static profile via new STC-PERF01 row + static_check_bundle_size in run-tests.sh. AC-2 (mission-planner exclusion) already covered by STC-S5. AC-3 FCP /flights <= 3 s median (chromium suite-e2e) and AC-4 30-min annotation soak (RUN_LONG_RUNNING=1, chromium) scaffolded as e2e tests. Code review: PASS (0 findings). Fast: 25/25 files, 150 passed / 13 skipped. Static: 25/25 PASS (incl. new STC-PERF01). Co-authored-by: Cursor <cursoragent@cursor.com>
2.3 KiB
Test — PhotoMode Switch & yoloId Wire
Task: AZ-473_test_photo_mode
Name: PhotoMode switch + auto-select + yoloId offsetting on the wire
Description: Implement the 3 blackbox tests pinning PhotoMode behavior: switching modes sets the offset filter, auto-selecting when the prior class is no longer valid, and the on-wire classNum == classId + photoModeOffset assertion.
Complexity: 2 points
Dependencies: AZ-456_test_infrastructure
Component: 06_annotations (PhotoModeContext + AnnotationsPage) (Blackbox Tests)
Tracker: AZ-473
Epic: AZ-455
Problem
PhotoMode offsets classId to classNum on the wire (classNum == classId + photoModeOffset). Getting this wrong leaks a different class on every save without any user-visible symptom — until a downstream consumer mis-buckets the data.
Outcome
- 3 scenarios pass — mode switch, auto-select on invalid, wire offset arithmetic.
Scope
Included
| Scenario | Profile | Source file |
|---|---|---|
| FT-P-48 — PhotoMode switch — mode set + filter | fast | blackbox-tests.md |
| FT-P-49 — PhotoMode auto-select when prior class no longer valid | fast | blackbox-tests.md |
FT-P-50 — yoloId on the wire — classNum == classId + photoModeOffset |
fast + e2e | blackbox-tests.md |
Excluded
- DetectionClasses load + hotkeys (covered in 17_test_detection_classes).
Acceptance Criteria
AC-1: Switch sets filter
FT-P-48 — toggling PhotoMode updates the rendered class list (filter applied); the selected mode is persisted in <PhotoModeContext> (asserted via the rendered filter, not via context read).
AC-2: Auto-select FT-P-49 — switching to a mode where the currently-selected class is out-of-range auto-selects the first valid class in the new window.
AC-3: Wire offset
FT-P-50 — issue an annotation save in mode P; outbound body carries classNum == classId + P for every detection.
System Under Test Boundary
- System under test:
<PhotoModeContext>+<AnnotationsPage>save call. - Allowed stubs: MSW for
/api/annotations/classes+ annotation save. - Disallowed: reading
<PhotoModeContext>state directly. - Expected observables per
results_report.mdrows 77-80 region.
Constraints
- Tests exercise all three modes (P ∈ {0, 20, 40}); each saves a probe annotation and asserts the wire offset.