mirror of
https://github.com/azaion/ui.git
synced 2026-06-21 18:11:10 +00:00
[AZ-461] [AZ-464] [AZ-470] [AZ-472] Batch 5 - detection/bulk-validate/panel-width/classes tests
ci/woodpecker/push/build-arm Pipeline was successful
ci/woodpecker/push/build-arm Pipeline was successful
- 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>
This commit is contained in:
@@ -1,62 +0,0 @@
|
||||
# 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.
|
||||
@@ -1,55 +0,0 @@
|
||||
# Test — Bulk-Validate (Dataset)
|
||||
|
||||
**Task**: AZ-464_test_bulk_validate
|
||||
**Name**: Bulk-validate URL + body + UI sync
|
||||
**Description**: Implement the 3 blackbox tests that pin the dataset bulk-validate path: outbound URL, request body shape, and the post-validate UI sync (≤2 s).
|
||||
**Complexity**: 2 points
|
||||
**Dependencies**: AZ-456_test_infrastructure
|
||||
**Component**: 07_dataset (Blackbox Tests)
|
||||
**Tracker**: AZ-464
|
||||
**Epic**: AZ-455
|
||||
|
||||
## Problem
|
||||
|
||||
Bulk-validate is a single mutation that flips many `mediaStatus` values; getting the URL or the body wrong corrupts an arbitrary number of seeds. A targeted contract test pins both, plus a 2-s sync deadline catches stale-UI regressions.
|
||||
|
||||
## Outcome
|
||||
|
||||
- 3 scenarios pass per the contract.
|
||||
|
||||
## Scope
|
||||
|
||||
### Included
|
||||
|
||||
| Scenario | Profile | Source file |
|
||||
|----------|---------|-------------|
|
||||
| FT-P-20 — bulk-validate request URL and body | fast + e2e | blackbox-tests.md |
|
||||
| FT-P-21 — bulk-validate UI reflects new status within 2 s | fast + e2e | blackbox-tests.md |
|
||||
| NFT-PERF-07 — bulk-validate UI reflects new status within 2 s | fast | performance-tests.md |
|
||||
|
||||
### Excluded
|
||||
|
||||
- Individual annotation status changes (covered in 05_test_annotations_endpoint).
|
||||
- Dataset filtering / paging (out of scope for the baseline test suite — feature-cycle work).
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
**AC-1: URL canary**
|
||||
FT-P-20 captures the outbound bulk-validate URL and asserts it equals the contract value.
|
||||
|
||||
**AC-2: Body shape**
|
||||
FT-P-20 captures the outbound body and asserts it carries the expected media-ID set + the target status value.
|
||||
|
||||
**AC-3: UI sync deadline**
|
||||
FT-P-21 / NFT-PERF-07 measure the wall-clock from response receipt to DOM update of the dataset list rows; asserts ≤2 s.
|
||||
|
||||
## System Under Test Boundary
|
||||
|
||||
- System under test: `<DatasetPage>` + its bulk-validate action handler + `src/api/client.ts`.
|
||||
- Allowed stubs: MSW for the dataset bulk-validate endpoint; real `annotations/` service for e2e.
|
||||
- Disallowed: reading React state to assert UI sync — the test reads the rendered DOM (table rows / status badges).
|
||||
- Expected observables compared against `results_report.md` rows 36-37.
|
||||
|
||||
## Constraints
|
||||
|
||||
- Use the `seed_media` fixture's 6-row baseline so the bulk operation is bounded.
|
||||
@@ -1,54 +0,0 @@
|
||||
# Test — Panel-Width Persistence
|
||||
|
||||
**Task**: AZ-470_test_panel_width_persistence
|
||||
**Name**: Panel-width debounced PUT + rehydration on reload
|
||||
**Description**: Implement the 3 blackbox tests pinning the panel-width persistence behavior: a debounced PUT (≤1 s after resize-end) and rehydration of the saved width on reload.
|
||||
**Complexity**: 2 points
|
||||
**Dependencies**: AZ-456_test_infrastructure
|
||||
**Component**: 10_app-shell + 06_annotations (split panels) (Blackbox Tests)
|
||||
**Tracker**: AZ-470
|
||||
**Epic**: AZ-455
|
||||
|
||||
## Problem
|
||||
|
||||
Layout preferences are a quality-of-life feature that must NOT thrash the suite with PUTs (debounce required) and MUST persist across reloads (saved-state contract). Both regress silently — users notice but rarely report.
|
||||
|
||||
## Outcome
|
||||
|
||||
- 3 scenarios pass.
|
||||
|
||||
## Scope
|
||||
|
||||
### Included
|
||||
|
||||
| Scenario | Profile | Source file |
|
||||
|----------|---------|-------------|
|
||||
| FT-P-37 — panel-width persistence — debounced PUT on resize end | fast | blackbox-tests.md |
|
||||
| FT-P-38 — panel-width rehydration on reload | fast + e2e | blackbox-tests.md |
|
||||
| NFT-PERF-08 — panel-width persistence debounce ≤ 1 s after resize-end | fast | performance-tests.md |
|
||||
|
||||
### Excluded
|
||||
|
||||
- Flight-selection persistence (covered in 08_test_flight_selection_persistence) — different state key but same `PUT /api/annotations/settings/user` endpoint.
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
**AC-1: Debounce window**
|
||||
Multiple resize events within 1 s yield exactly one outbound PUT. Asserted via captured request log.
|
||||
|
||||
**AC-2: Body shape**
|
||||
The PUT body carries the `panelWidths` field (per the contract).
|
||||
|
||||
**AC-3: Rehydration**
|
||||
After reload with `seed_user_settings.panelWidths` set, the rendered panel widths match the seed.
|
||||
|
||||
## System Under Test Boundary
|
||||
|
||||
- System under test: panel split component(s) + `<UserSettings>` save path.
|
||||
- Allowed stubs: MSW for `PUT /api/annotations/settings/user`.
|
||||
- Disallowed: reading internal React state.
|
||||
- Expected observables per `results_report.md` rows 64-65.
|
||||
|
||||
## Constraints
|
||||
|
||||
- Use Vitest fake-timers to simulate the debounce window deterministically.
|
||||
@@ -1,59 +0,0 @@
|
||||
# Test — DetectionClasses (Load, Hotkeys, Click, Fallback)
|
||||
|
||||
**Task**: AZ-472_test_detection_classes
|
||||
**Name**: DetectionClasses load + 1-9 hotkeys + click path + empty/5xx fallback
|
||||
**Description**: Implement the 4 blackbox tests pinning `<DetectionClasses>` behavior: load from `/api/annotations/classes`, hotkey 1-9 → `classes[(key-1) + P]` (P = current PhotoMode offset), click-to-select path, and the fallback list when the API is empty or 5xx.
|
||||
**Complexity**: 3 points
|
||||
**Dependencies**: AZ-456_test_infrastructure
|
||||
**Component**: 06_annotations (DetectionClasses) + 11_class-colors (Blackbox Tests)
|
||||
**Tracker**: AZ-472
|
||||
**Epic**: AZ-455
|
||||
|
||||
## Problem
|
||||
|
||||
`<DetectionClasses>` is keyboard-driven during annotation; the hotkey-to-class mapping changes with PhotoMode (offset P). Wrong P leaks the wrong class number on save — a quality regression hard to spot without explicit hotkey tests.
|
||||
|
||||
## Outcome
|
||||
|
||||
- 4 scenarios pass — load contract, hotkey arithmetic, click selection, fallback robustness.
|
||||
|
||||
## Scope
|
||||
|
||||
### Included
|
||||
|
||||
| Scenario | Profile | Source file |
|
||||
|----------|---------|-------------|
|
||||
| FT-P-44 — DetectionClasses loads from `/api/annotations/classes` | fast + e2e | blackbox-tests.md |
|
||||
| FT-P-45 — class hotkey 1–9 selects `classes[(key-1) + P]` | fast | blackbox-tests.md |
|
||||
| FT-P-46 — class click path | fast | blackbox-tests.md |
|
||||
| FT-P-47 — fallback class list on API empty/5xx | fast | blackbox-tests.md |
|
||||
|
||||
### Excluded
|
||||
|
||||
- PhotoMode switching itself (covered in 18_test_photo_mode).
|
||||
- Class CRUD via Admin (out of scope; per-feature task in Phase B).
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
**AC-1: Load contract**
|
||||
FT-P-44 — outbound URL is `/api/annotations/classes`; response shape matches `seed_classes` (per the contract).
|
||||
|
||||
**AC-2: Hotkey arithmetic**
|
||||
FT-P-45 — for each PhotoMode P ∈ {0, 20, 40}, pressing keys 1..9 selects the corresponding class from the appropriate window of 9.
|
||||
|
||||
**AC-3: Click**
|
||||
FT-P-46 — clicking a class entry selects that class; outbound annotation save (if any) carries the right classId.
|
||||
|
||||
**AC-4: Fallback**
|
||||
FT-P-47 — when `/api/annotations/classes` returns 200 with `[]` or any 5xx, the fallback class list is rendered; tests assert the fallback length and a marker indicating fallback mode.
|
||||
|
||||
## System Under Test Boundary
|
||||
|
||||
- System under test: `<DetectionClasses>` + `<PhotoModeContext>` (read-only here).
|
||||
- Allowed stubs: MSW for `/api/annotations/classes`.
|
||||
- Disallowed: stubbing `<DetectionClasses>` or reading its React state.
|
||||
- Expected observables per `results_report.md` rows 73-77 (Group 16).
|
||||
|
||||
## Constraints
|
||||
|
||||
- `seed_classes` MUST satisfy N≥9 (per test-data.md) so all hotkeys 1..9 are hot in P=0.
|
||||
Reference in New Issue
Block a user