test(tests): working-copy dialog checks independent of the shared slot

admin.spec opened the working-copy dialog on the historical sheet, whose
single slot was taken by a copy the sandbox suite leaked. The dialog checks
move to an e2e:ui page on the real component; the suite archives its own copies.
This commit is contained in:
bchanot committed 2026-11-12 17:06:42 +01:00
1 parent da298cfab1
commit 2cdee42fe1
9 files changed
+304 -25

No files matched your search

+14 -1
View File
@@ -9,7 +9,7 @@ engines are installed. The suites live in `apps/app/e2e`.
| Command | Backend | Dev server | Content |
|---|---|---|---|
| `pnpm e2e:ui` | none | Vite on `127.0.0.1:5191` | `e2e/ui/dialog.spec.ts`: the D13 contract of the shared Dialog on a test page; `e2e/ui/local-tool.spec.ts`: the disclaimer, edit and replace dialogs on the real local-tool routes |
| `pnpm e2e:ui` | none | Vite on `127.0.0.1:5191` | `e2e/ui/dialog.spec.ts`: the D13 contract of the shared Dialog on a test page; `e2e/ui/working-copy.spec.ts`: the real `WorkingCopyAction` and its dialog on a test page (axe, layout, keyboard, fr and en, desktop and 375 px); `e2e/ui/local-tool.spec.ts`: the disclaimer, edit and replace dialogs on the real local-tool routes |
| `pnpm e2e:shell` | the isolated stack of `pnpm db:sandbox` | Vite on `127.0.0.1:5192` | `e2e/shell/shell.spec.ts`: sign-in, dashboard, the account photo confirmation, the phone drawer; `e2e/shell/clients.spec.ts`: the client journeys (V1-1.5); `e2e/shell/animals.spec.ts`: the animal and relation journeys (V1-1.6, contract §11.8); `e2e/shell/responsive.spec.ts`: no sideways scroll on nine shell pages, the archive confirmations and the drawer at 320, 360, 375, 390 and 430 px (phone project) and 1280 px, long values, the dashboard e-mail shown whole (RESP-01); `e2e/shell/admin.spec.ts` (V1-2.5): A0 the owner's bootstrap (two TOTP factors from Sécurité, the step-up at `/app/admin` and inside a factor action, no second factor from `aal1`, refresh keeping `aal1` and `aal2`, rights granted and revoked with their reason), A1 a sheet created by an editor on a new inactive species, S1 a species created inactive then activated by the owner, the creation page when the own-grants read fails (« Impossible de vérifier vos autorisations » and « Réessayer », never the form; Retry brings the form back), access per right (a reviewer-only account refused on the creation page), axe and no sideways scroll on every admin page; `e2e/shell/catalogue.spec.ts` (V1-2.5): P1 a reader searches, opens a sheet, picks a zone, reads a retired version, drafts and archived sheets never listed, the same refusal for an existing and an unknown sheet without access, 320, 375 and 430 px with the whole drawing in the box at opening; at 320 and 375 px the zone panel's live region present before a pick and naming the picked zone, the « Références » card starting at or below the drawing's bottom; `e2e/shell/editor-*.spec.ts` (V1-2.6, the draft editor level 1, contract C16 to C34): `editor-drawings` (A2: a hostile file refused with no cleaning box, an Inkscape export cleaned after its preview, a valid file attached, a detail view by crop, the same bytes attached twice), `editor-annotations` (A3: points, zones and links by clicks and by keyboard only, move by drag, a click with jitter never moves, numeric edits, undo and redo, review and delete), `editor-geometry` (a click near a frame edge with the corrected position confirmed and cancelled, an inherited out-of-frame point repaired through the geometry group, a crop change refused when it would invalidate a point, an unmeasured view with its tools disabled, touch-action and a touch drag in real Chromium), `editor-structures` (A4: categories, references, regions, findings tree, reorder, mark reviewed, delete with dependents), `editor-journey` (the steps of `V1-2-6_OWNER_TRIAL.md` §4 with two editor accounts: creation, drawing, findings, annotations, save, reload with the beforeunload dialog and the recovery offer, conflict, submission, the round read back in SQL), `editor-recovery` (two sessions, an older local copy restored then saved over a newer revision, a pending offer blocking edits, an unreadable copy kept until « Ignorer », Escape on the conflict read, the editor grant revoked, the admin role removed and the grant expired under an open session), `editor-access` (a reviewer-only account read-only, the not-found screen for an editor without the admin role and for an admin without a capability, 320, 375 and 800 px read-only, 1 024 px editing, axe on every tab edit and read-only), `editor-deselect` (R1, D5 and D6b: « Désélectionner » with its live region, the focus on the list row and the document unchanged; Escape over the canvas, a field, the delete dialog, the references panel and a tracing; mouse clicks on empty parts deselecting, on annotations selecting; zoom, pan, marker drag and Ctrl+wheel keeping the selection; a typed value applied by the deselecting click; at 1 280 px with `hasTouch` and CDP touch taps near annotations and the canvas bottom deselecting once, drags, two-finger taps and pinch keeping the selection, with the pointer events counted by a recorder; the read-only twin at 375 px and Escape closing « Plus » before deselecting; the drawing's top unchanged when a point, a zone and a link are selected then deselected, on desktop and on the read-only twin at 375 px, with the selection tag out of the visual flow), `editor-equine` (the historical equine sheet opened as a working copy, a copy left active by an earlier run set aside and put back; commit latency on it and on a synthetic document near 2 MiB, printed as `LATENCY` lines and kept as test annotations, budget 500 ms per commit on the equine copy; one empty click on a bone of the horse drawing deselects, D6b). U1 shell (V1-2.6 U1, the four-tab shell): `editor-shell` (kept-mounted places, focus on a named element, the open panel leaving the header and the tab row clickable at 1 024 and 1 280 px, the sidebar from 1 280 px and the drawer, canvas widths), `editor-shell-journeys` (four tabs, cross-tab undo, typed text then the header undo, a refused field kept through a real Shift+Tab to « Défaire », Ctrl+ZLine truncated
Each suite runs on two Chromium projects: `chromium-desktop` (1280 × 800) and
@@ -23,6 +23,19 @@ The test page `e2e/harness/dialog.html` is served by the dev server only
never ships. It holds the D13 cases (basic, long content, refused close,
vanishing opener) and no product journey.
The test page `e2e/harness/working-copy.html` (same rules) renders the
application's own `WorkingCopyAction` twice, slot free and slot taken, under
`StrictMode` and a `MemoryRouter`; no request is made. Coverage change
(anomaly B, V1-2-6_U1_CORRECTIONS.md §5): the dialog's axe, layout and
keyboard checks moved there from the « admin screens » test of
`e2e/shell/admin.spec.ts`, because only the historical sheet offers the
action and the single working-copy slot is shared, mutable database state.
The shell test keeps the historical page in its axe and overflow loop and
checks that the button is disabled exactly when its reason is shown and
linked. Limit: the dialog is no longer checked in its real server context by
this accessibility test; the server refusals stay covered by
`packages/supabase/tests/sandbox/sheets-admin.sandbox.ts`.
The shell suite never reaches DEV. Its dev server is built with the Supabase
URL `http://sandbox.faunosteo.invalid` (a name that resolves nowhere,
RFC 6761); `e2e/support/sandbox.ts` replays `/auth/v1`, `/rest/v1` and
+4 -4
View File
@@ -43,7 +43,7 @@ Companion: `TRIAL_STACK.md` (the dedicated manual trial stack, request §5).
Every lot: one commit or more per coherent change, pushed; gates in this order: `pnpm typecheck`, `pnpm lint`,
`pnpm test:run`, `pnpm build`, `pnpm e2e:ui`, then the shell suite on the sandbox as it stands, with its exact result
(the suite is not green today: four `admin.spec.ts:717` failures from the taken working-copy slot, anomaly B). Every
(the four `admin.spec.ts:717` failures of the taken working-copy slot, anomaly B, are fixed: row B of section 5). Every
removed or rewritten assertion is mapped to its replacement in the commit message (R-24). Design gates: the boards of
R0 as validated, `impeccable detect` on the changed components, a fresh design review before the lot closes.
@@ -243,15 +243,15 @@ The criteria below are the contract as written.
R0 first (validation). R1 is independent of R2 and can ship first. R2 depends on the validated boards 23 to 27. R3
ships search and name sort first; its date part waits for the SQL checkpoint (A7 ratified).
R4 is independent and may run any time after its board (30) is validated. Anomaly B (section 5) should land before
the gates of R2 and R3 are read, since its taken slot fails four admin specs on every run.
R4 is independent and may run any time after its board (30) is validated. Anomaly B (section 5) is fixed: the admin specs no longer
depend on the working-copy slot.
## 5. Test anomalies tracked apart (D9)
| Item | Cause | Constraint |
|---|---|---|
| A. Fictitious fingerprints | Worker stand-ins publish with `'a'.repeat(64)`: `packages/supabase/tests/sandbox/sheet-fixtures.ts:115` (`openRound`), `sheets-concurrency.sandbox.ts:168`, `sheets-perf.sandbox.ts:169`. Seven published or deprecated versions on the sandbox fail `check_published`; the owner opened three of them on 2026-11-09. | Compute the real fingerprint through the core as the catalogue e2e does (`fingerprintOf`), never weaken the publish gate or the reader's check. |
| B. Working copy never archived | `packages/supabase/tests/sandbox/sheets-admin.sandbox.ts:181-195` creates the historical sheet's working copy (`8c315a12-…`, 2026-11-08 21:00:30) and never archives it; the single slot then disables « Créer une copie de travail » (`WorkingCopyAction.tsx:88`) and fails `admin.spec.ts:717` four times. | Make the suite independent (its own cleanup, or a precondition it creates and removes); the existing copy is not touched before the owner authorises it. |
| B. Working copy never archived | (a) `packages/supabase/tests/sandbox/sheets-admin.sandbox.ts` created the historical sheet's working copy (`8c315a12-…`, 2026-11-08 21:00:30) and never archived it; the single slot then disables « Créer une copie de travail » (`WorkingCopyAction.tsx:88`). (b) Even on a fresh stack `editor-equine.spec.ts` flips the slot while `admin.spec.ts:717` runs in parallel. Only the historical sheet offers the action, so the test depended on shared state. | FIXED (owner, 2026-11-12, option 1): the dialog's axe, layout and keyboard checks run on the real component in `e2e/ui/working-copy.spec.ts`; `admin.spec.ts` keeps the historical page and checks the button state against its reason; the sandbox suite archives only the copies it created (`returning id` checked) and each cleanup step runs independently. Limit: the dialog is no longer checked in its real server context by this accessibility test. Open: the creation branch of the cleanup is not yet run on a fresh stack. `editor-equine.spec.ts` still archives and restores pre-existing copies on every run. |
| C. Silent card failure | Section 3, R4. | Show the failure, never hide or route around it. |
## 6. Arbitrations