From d01019d6c77cbbbebdd8fd976ef651e87f22d491 Mon Sep 17 00:00:00 2001 From: bchanot Date: Mon, 23 Nov 2026 10:31:03 +0100 Subject: [PATCH] fix(anatomy): name both D11 pick sites, restore the spy in afterEach --- apps/app/tests/unit/components.AnatomyCanvas.test.tsx | 6 ++++-- docs/ANNOTATION-RENDERING.md | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/app/tests/unit/components.AnatomyCanvas.test.tsx b/apps/app/tests/unit/components.AnatomyCanvas.test.tsx index 5eceb481..e6843f04 100644 --- a/apps/app/tests/unit/components.AnatomyCanvas.test.tsx +++ b/apps/app/tests/unit/components.AnatomyCanvas.test.tsx @@ -17,7 +17,10 @@ let sheet: SheetIndex beforeAll(async () => { sheet = await loadTestSheet() }) -afterEach(cleanup) +afterEach(() => { + cleanup() + vi.restoreAllMocks() +}) /** The composed view, or a test failure naming why it is missing. */ function svgOf(index: SheetIndex, viewId: string): SVGSVGElement { @@ -110,7 +113,6 @@ describe('AnatomyCanvas', () => { const name = hip.getAttribute('data-anno-name-fr') expect(name).toBeTruthy() expect(container.textContent).toContain(name) - vi.restoreAllMocks() }) it('applies the states right after the build, on both elements of a point', async () => { diff --git a/docs/ANNOTATION-RENDERING.md b/docs/ANNOTATION-RENDERING.md index 7400d138..89a2e054 100644 --- a/docs/ANNOTATION-RENDERING.md +++ b/docs/ANNOTATION-RENDERING.md @@ -69,8 +69,10 @@ id or a class. An access (kind `detail_trigger`) never hides another annotation (D11). On the editor, the catalogue and the bilan, the page reads every element under the -pointer (`elementsFromPoint`, bounded to the canvas, `anatomy/annotationPick.ts`) -and takes the first annotation that is not an access; an access answers only +pointer (`elementsFromPoint`, bounded to the canvas) and takes the first +annotation that is not an access (`anatomy/annotationPick.ts` for the catalogue +and the bilan; the editor applies the same rule in `editor/annotations/press.ts`, +`Hit.access` and `pressTarget`, bounded by the viewport); an access answers only where no other annotation lies. The same pick drives the click and the tooltip. The paint order of the core is unchanged. The access labels (Part 6) are page buttons over the drawing, outside the layer. The canvas sets and removes