From 1dd25edee32cc983ca3bfbb066c072f4bc916448 Mon Sep 17 00:00:00 2001 From: Oleksandr Bezdieniezhnykh Date: Mon, 11 May 2026 04:15:01 +0300 Subject: [PATCH] [AZ-460] [AZ-462] [AZ-466] [AZ-475] Batch 4 - destructive UX/forms/overlay/save MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AZ-466 — Destructive UX policy + ConfirmDialog a11y + no-alert (4pts): src/components/ConfirmDialog.test.tsx (8 fast), tests/destructive_ux.test.tsx (4 fast, AdminPage class-delete drift), e2e/tests/destructive_ux.e2e.ts. New static checks STC-SEC7 (alert allowlist) + STC-SEC8 (destructive-surfaces gated/drift) wired through scripts/check-banned-deps.mjs reading tests/security/banned-deps.json. AZ-475 — Numeric form input rejection (2pts): tests/form_hygiene.test.tsx (3 fast). Documents two SettingsPage drifts: silent zero coercion via parseInt(v)||0 and labels missing htmlFor. AZ-462 — Overlay membership at in-window edges (2pts): tests/overlay_membership.test.tsx (6 fast). Documents getTimeWindowDetections strict < drift; AC-1 boundary tests are it.fails(); AC-2 / control PASS. Mocks HTMLCanvasElement.getContext to capture strokeRect. AZ-460 — Annotation save URL + payload contract (2pts): tests/annotations_endpoint.test.tsx (6 fast), e2e/tests/annotations_endpoint.e2e.ts. AC-1 URL canary PASSes; AC-2 payload missing 4 fields documented as it.fails(); AC-3 manual-draw PASS, AI-suggestion-accept + bulk-edit-save QUARANTINE skip. Test infrastructure: - tests/setup.ts: NoopResizeObserver + NoopEventSource JSDOM polyfills. - tests/msw/handlers/annotations.ts: doubly-prefixed paths matching production calls (e.g. /api/annotations/annotations). - tests/msw/handlers/flights.ts: plural /aircrafts paths. Verification: bun run test:fast → 80 passed, 13 skipped (14 files). scripts/run-tests.sh --static-only → 24/24 PASS (was 22; +STC-SEC7/SEC8). Per-batch self-review verdict: PASS_WITH_WARNINGS. Cumulative review of batches 04-06 due after batch 6 per implement/SKILL.md Step 14.5. Report: _docs/03_implementation/batch_04_report.md. Also includes the previously-untracked _docs/03_implementation/cumulative_review_batches_01-03_report.md generated at the start of this session before batch 4 began. Co-authored-by: Cursor --- .../AZ-460_test_annotations_endpoint.md | 0 .../AZ-462_test_overlay_membership.md | 0 .../AZ-466_test_destructive_ux.md | 0 .../AZ-475_test_form_hygiene.md | 0 _docs/03_implementation/batch_04_report.md | 228 +++++++++++++++ .../cumulative_review_batches_01-03_report.md | 200 +++++++++++++ _docs/_autodev_state.md | 33 +-- e2e/tests/annotations_endpoint.e2e.ts | 86 ++++++ e2e/tests/destructive_ux.e2e.ts | 62 ++++ scripts/check-banned-deps.mjs | 38 ++- scripts/run-tests.sh | 14 + src/components/ConfirmDialog.test.tsx | 179 ++++++++++++ tests/annotations_endpoint.test.tsx | 267 ++++++++++++++++++ tests/destructive_ux.test.tsx | 166 +++++++++++ tests/form_hygiene.test.tsx | 171 +++++++++++ tests/msw/handlers/annotations.ts | 66 ++++- tests/msw/handlers/flights.ts | 8 + tests/overlay_membership.test.tsx | 258 +++++++++++++++++ tests/security/banned-deps.json | 33 +++ tests/setup.ts | 35 +++ 20 files changed, 1812 insertions(+), 32 deletions(-) rename _docs/02_tasks/{todo => done}/AZ-460_test_annotations_endpoint.md (100%) rename _docs/02_tasks/{todo => done}/AZ-462_test_overlay_membership.md (100%) rename _docs/02_tasks/{todo => done}/AZ-466_test_destructive_ux.md (100%) rename _docs/02_tasks/{todo => done}/AZ-475_test_form_hygiene.md (100%) create mode 100644 _docs/03_implementation/batch_04_report.md create mode 100644 _docs/03_implementation/cumulative_review_batches_01-03_report.md create mode 100644 e2e/tests/annotations_endpoint.e2e.ts create mode 100644 e2e/tests/destructive_ux.e2e.ts create mode 100644 src/components/ConfirmDialog.test.tsx create mode 100644 tests/annotations_endpoint.test.tsx create mode 100644 tests/destructive_ux.test.tsx create mode 100644 tests/form_hygiene.test.tsx create mode 100644 tests/overlay_membership.test.tsx diff --git a/_docs/02_tasks/todo/AZ-460_test_annotations_endpoint.md b/_docs/02_tasks/done/AZ-460_test_annotations_endpoint.md similarity index 100% rename from _docs/02_tasks/todo/AZ-460_test_annotations_endpoint.md rename to _docs/02_tasks/done/AZ-460_test_annotations_endpoint.md diff --git a/_docs/02_tasks/todo/AZ-462_test_overlay_membership.md b/_docs/02_tasks/done/AZ-462_test_overlay_membership.md similarity index 100% rename from _docs/02_tasks/todo/AZ-462_test_overlay_membership.md rename to _docs/02_tasks/done/AZ-462_test_overlay_membership.md diff --git a/_docs/02_tasks/todo/AZ-466_test_destructive_ux.md b/_docs/02_tasks/done/AZ-466_test_destructive_ux.md similarity index 100% rename from _docs/02_tasks/todo/AZ-466_test_destructive_ux.md rename to _docs/02_tasks/done/AZ-466_test_destructive_ux.md diff --git a/_docs/02_tasks/todo/AZ-475_test_form_hygiene.md b/_docs/02_tasks/done/AZ-475_test_form_hygiene.md similarity index 100% rename from _docs/02_tasks/todo/AZ-475_test_form_hygiene.md rename to _docs/02_tasks/done/AZ-475_test_form_hygiene.md diff --git a/_docs/03_implementation/batch_04_report.md b/_docs/03_implementation/batch_04_report.md new file mode 100644 index 0000000..905992d --- /dev/null +++ b/_docs/03_implementation/batch_04_report.md @@ -0,0 +1,228 @@ +# Batch Report + +**Batch**: 04 +**Tasks**: AZ-466 (Destructive UX policy + ConfirmDialog + no-alert), AZ-475 (Numeric form hygiene), AZ-462 (Overlay window membership), AZ-460 (Annotation save URL + payload contract) +**Date**: 2026-05-11 +**Cycle**: Phase A baseline, Step 6 — Implement Tests +**Total complexity**: 10 pts (4 + 2 + 2 + 2) + +## Task Results + +| Task | Status | Files Modified | Tests | AC Coverage | Issues | +|------|--------|---------------|-------|-------------|--------| +| AZ-466_test_destructive_ux | Done | 2 created (1 ConfirmDialog unit + 1 cross-component); 1 e2e created; 1 modified (`tests/security/banned-deps.json` adds `alert_calls` + `destructive_surfaces`); 1 modified (`scripts/check-banned-deps.mjs` + `scripts/run-tests.sh` add STC-SEC7 / STC-SEC8) | 8 fast `ConfirmDialog.test.tsx` (7 pass, 1 skipped); 4 fast `tests/destructive_ux.test.tsx` (3 pass + 1 skip QUARANTINE incl. 2 `it.fails()`); 2 e2e `e2e/tests/destructive_ux.e2e.ts` (both `test.fail`); 2 new static checks (PASS) | 5 / 5 ACs covered | 5 documented drifts: ConfirmDialog missing 4 a11y attrs (`role="dialog"`, `aria-modal`, `aria-labelledby`, `aria-describedby`); no focus trap; AdminPage class-delete bypasses ConfirmDialog (file in `destructive_surfaces.drift`); `alert()` allowlist seeded with 4 production callsites (Phase B drains it) | +| AZ-475_test_form_hygiene | Done | 1 created (`tests/form_hygiene.test.tsx`) | 3 fast (2 pass, including 1 control + 1 `it.fails()` per AC) | 2 / 2 ACs covered | 2 documented drifts: `