Files
ui/_docs/02_tasks/done/AZ-461_test_detection_endpoints.md
T
Oleksandr Bezdieniezhnykh 6d03643c2c
ci/woodpecker/push/build-arm Pipeline was successful
[AZ-461] [AZ-464] [AZ-470] [AZ-472] Batch 5 - detection/bulk-validate/panel-width/classes tests
- AZ-461 sync image detect URL canary (FT-P-11) PASS;
  async-video QUARANTINE (FT-P-12) + X-Refresh-Token drift
  (FT-P-13) recorded as it.fails() with controls.
- AZ-464 bulk-validate URL + UI sync (≤2 s) PASS;
  body shape drift {annotationIds,status} vs contract
  {ids,targetStatus:30} captured as it.fails().
- AZ-470 panel-width debounce + rehydration: entire task
  is Phase-B target (useResizablePanel has no PUT writer
  / no rehydration); 3 ACs as it.fails() with controls.
- AZ-472 DetectionClasses load + click + fallback PASS;
  hotkey arithmetic P=0 PASS, P=20/P=40 it.fails() for
  classes[idx+P]-against-dense-array drift.

Code review: PASS (0 findings). Fast: 18/18 files,
102 passed / 13 skipped. Static: 21/21 PASS.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 04:38:22 +03:00

3.1 KiB

Test — Detection Endpoints (Sync / Async / Long-Video)

Task: AZ-461_test_detection_endpoints Name: Detection endpoints — sync image + async video (Phase B target) + long-video header Description: Implement the three blackbox tests that exercise the detect/ service's three detection paths from the SPA: sync image detect (FT-P-11), async video detect SSE (FT-P-12, quarantined as Phase B target), and the X-Refresh-Token header carried on long-video detect (FT-P-13). Complexity: 2 points Dependencies: AZ-456_test_infrastructure Component: 06_annotations (detection sub-surface) (Blackbox Tests) Tracker: AZ-461 Epic: AZ-455

Problem

Detection is multimodal: sync for images (today), async with SSE updates for video (Phase B per AC-25), and long-video has its own header contract for token rotation. Without targeted tests, regressions slip in mode-by-mode.

Outcome

  • 3 test scenarios are present in their declared profile and reference their results_report.md rows.
  • FT-P-12 is QUARANTINEd in CI with a clear marker until the async-video path lands.

Scope

Included

Scenario Profile Source file results_report row
FT-P-11 — sync image detect endpoint fast + e2e blackbox-tests.md per FT-P-11
FT-P-12 — async video detect endpoint + SSE (target — Phase B) fast (quarantined) blackbox-tests.md per FT-P-12
FT-P-13 — long-video detect carries X-Refresh-Token header fast blackbox-tests.md per FT-P-13

Excluded

  • Annotation save after detect (covered in 05_test_annotations_endpoint).
  • Detection class CRUD (covered in 17_test_detection_classes).

Acceptance Criteria

AC-1: Sync image detect URL + body FT-P-11 asserts the outbound POST URL + body shape for sync image detect against the contract.

AC-2: Async video detect — quarantined FT-P-12 is implemented and registered, but marked Result: QUARANTINE in the CSV report until AC-25 (Phase B) lands. The test code itself runs (does not just xit) and produces a clear log entry "FT-P-12 awaits AC-25 / async video detect impl".

AC-3: Header carried FT-P-13 asserts every long-video detect request carries the X-Refresh-Token header.

System Under Test Boundary

  • System under test: the SPA's <AnnotationsPage> (or its detect-trigger sub-component) + src/api/client.ts.
  • Allowed stubs: MSW for /api/detect/* (fast); real detect/ service (e2e — async video path stays quarantined until the suite has it).
  • Disallowed: stubbing the SPA components or constructing the request manually from a unit test.
  • Expected observables per results_report.md rows for FT-P-11, 12, 13.

Constraints

  • FT-P-12 is QUARANTINE in CI, NOT skipped — the result must appear in the report with that status, traceable to AC-25.

Risks & Mitigation

Risk 1 — Async video detect path lands while tests are being implemented

  • Risk: AC-25 may go from target to shipped, flipping FT-P-12 from QUARANTINE to PASS / FAIL.
  • Mitigation: FT-P-12 reads the runtime UI to detect whether the path exists; the QUARANTINE marker is conditional on absence.