import { describe, it, expect, beforeEach } from 'vitest' import { http } from 'msw' import { server } from './msw/server' import { jsonResponse, noContent } from './msw/helpers' import { renderWithProviders, screen, waitFor, userEvent } from './helpers/render' import { seedBearer, clearBearer } from './helpers/auth' import AdminPage from '../src/features/admin/AdminPage' // AZ-466 — Destructive UX policy (cross-component half) // // AC-1 (FT-P-26): clicking Delete on a class → confirming → DELETE fires AFTER confirm. // AC-2 (FT-N-07): clicking Delete → Cancel → NO DELETE fires. // AC-4 (FT-P-27 / NFT-SEC-08): static check enumerates every destructive surface // and asserts each one mounts a ``. // The static side lives in `scripts/run-tests.sh` / // `scripts/check-banned-deps.mjs` (`STC-SEC8`). // The runtime mirror is one of the cases below. // AC-5 (NFT-SEC-07): no `alert()` in `src/`. Static side enforces this; runtime // side here only documents the current allowlist. The runtime // test would require renderring every component that calls // alert — out of black-box scope. Static check `STC-SEC7` // handles enforcement. // // Production drift (`src/features/admin/AdminPage.tsx:30-33` and table row // line 76): // `handleDeleteClass` directly calls `api.delete` without gating through // ``. The class-delete row's `