39 lines
7.3 KiB
Markdown
39 lines
7.3 KiB
Markdown
# Test fixtures
|
||
|
||
Golden inputs frozen for the characterisation tests (plan Step 1). They describe
|
||
the Report v2 document as the current application produces it.
|
||
|
||
| File | Content |
|
||
| --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||
| `report-v2.full.json` | One report exercising every zone kind the editor can produce: plain hinge point, bilateral joint with both sides, spine zone with vertebrae, detail-popup zone, catalog findings (with and without vet referral and side), free text, severity, comment, conclusion, recommendations, dated next appointment. `boneId` values are the real `data-anno-id` of the legacy `Horse.svg` / `Horse_head.svg` now kept under `supabase/seed/anatomical-sheets/equine/legacy-sources/`; `zoneId`/`path` values exist in `pathologies.json`. |
|
||
| `report-v2.minimal.json` | Smallest valid v2 report (no observations). |
|
||
| `report-v2.full.pdf`, `report-v2.minimal.pdf` | The two reports exported by the v2 pipeline (commit 199e328, Step 5.0, rasteriser stubbed to a 1×1 PNG, no logos): the archive-like PDFs the v3 importer must read and migrate. Synthetic data only. |
|
||
|
||
Do not edit these files to make a test pass: they are the behavioural oracle for
|
||
the Report v2 → v3 adapter and for PDF regression. Add a new fixture instead.
|
||
|
||
## Step 6 freeze (Phase 0, 2026-10-11)
|
||
|
||
What the PDF pipeline produced right before the Step 6 refactor, recorded by
|
||
`tests/unit/pdf.goldens.test.ts` on the bundled draft sheet
|
||
(`docs/development/STEP6_PDF_ARCHIVE_ANALYSIS.md` §17).
|
||
|
||
| File | Content |
|
||
| ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||
| `report-v3.demo.json` | Report v3 on the draft (ids from `draft/document.json`), 6 observations: main-view points, head-view points, spine zone with vertebrae, bilateral zone with both sides, a vet-referral leaf, a leaf whose label holds an en dash (U+2013), free-text findings, severities, comments, conclusion, recommendations, period next appointment; `sheet` = the draft ref at freeze time. |
|
||
| `report-v3.bare.pdf` | The demo report exported by the current code (rasteriser stubbed to a 1×1 PNG, no logos, FR): import fixture for the engine. |
|
||
| `goldens/step6/text.<report>.<locale>.<logos>.json` | Every `drawText` of the export, in drawing order: `{ page, text, x, y, size, font }`, numbers rounded to 2 decimals. |
|
||
| `goldens/step6/images.<report>.<locale>.<logos>.json` | Every `drawImage`: `{ page, x, y, width, height }`. Recorded per locale too: the footer centres the "powered by" block on the label width, so the ZenQuality logo shifts between FR and EN. |
|
||
| `goldens/step6/links.<report>.<locale>.<logos>.json` | Every `/Annot /Link` read back from the saved PDF: `{ page, rect, uri }`. Per locale for the same footer reason. |
|
||
| `goldens/step6/views.<report>.json` | Per `(observation, view)` of the report, the highlighted SVG parsed: `viewBox`, halo filter present, highlighted elements, visible non-highlighted markers, remaining `data-*` attributes, `<title>` count. |
|
||
|
||
Reports: `v2full` (`report-v2.full.json` migrated), `demo` (`report-v3.demo.json`),
|
||
`v2unresolved` (legacy `sphenoid` and `ssb` leaves plus one `frontal` leaf, migrated;
|
||
zone-less, so its `images` and `views` goldens are empty). Logo modes: `nologos`
|
||
(every branding slot empty, 1×1 rasteriser) and `logos` (the four logo files bundled
|
||
under `apps/app/src/assets/brand`, rasteriser stubbed to a 2×1 PNG).
|
||
|
||
Never regenerate these files without a user decision; the Step 6 engine must
|
||
reproduce them. Generation, once: `MAKE_GOLDEN=1 corepack pnpm vitest run
|
||
tests/unit/pdf.goldens.test.ts` from `apps/app`.
|