test(tests): prove the line and redraw fixes without a shift

Final review M-3, M-4, M-5, M-6 in the sandbox suites:
- editor-annotations (A14 at 1024, 1180, 1280 px): « Défaire » on the
  line hit-tested 44 px tall below xl and 36 px from xl, its pill 36
  px; pressed under expectNoShift, the drawing then has the focus.
- editor-geometry: the same refused move twice under expectNoShift is
  a new alert pill.
- editor-zones: « Redessiner » takes the focus back after a close and
  a cancel; with the strip scrolled out and the focus on body, the
  close returns it with no scroll.

Tests: no assertion removed.
This commit is contained in:
bchanot committed 2026-11-18 13:21:32 +01:00
1 parent a6685a04e0
commit f2bf442ecd
3 files changed
+91 -17

No files matched your search

+28
View File
@@ -217,6 +217,8 @@ test.describe('editor zones on the drawing (U2 Task 5)', () => {
dict['editor.annotations.message.redrawn.zone'],
)
})
// M-6: the focus is back on « Redessiner », which started the redraw.
await expect(button(page, 'editor.annotations.redraw')).toBeFocused()
await expect(selectionTag(page)).toContainText('Vertèbres thoraciques')
expect(await count(page)).toBe(4)
await undoTo(page, () => shownPoints(page), stored)
@@ -242,6 +244,32 @@ test.describe('editor zones on the drawing (U2 Task 5)', () => {
button(page, 'editor.annotations.trace_cancel').click(),
)
await expect.poll(() => shownPoints(page)).toEqual(stored)
await expect(button(page, 'editor.annotations.redraw')).toBeFocused()
// M-6: the strip out of view, the focus on body, the close pressed in place (no scroll
// into view): the focus goes back to « Redessiner » without a scroll (A14).
await expectNoShift(page, () =>
button(page, 'editor.annotations.redraw').click(),
)
for (const [x, y] of [
[850, 440],
[1100, 470],
[1100, 560],
[850, 545],
])
await expectNoShift(page, () => clickAt(page, x, y))
const strip = (await page.getByTestId('edit-strip').boundingBox())!
await page.evaluate((by) => window.scrollBy(0, by), strip.y + strip.height)
await page.evaluate(() => (document.activeElement as HTMLElement).blur())
await expectNoShift(page, async () => {
await button(page, 'editor.annotations.trace_close').dispatchEvent(
'click',
)
await expect(line(page)).toContainText(
dict['editor.annotations.message.redrawn.zone'],
)
})
await expect(button(page, 'editor.annotations.redraw')).toBeFocused()
})
test('a click inside Thoraciques on C7-T1 selects the point drawn on top', async ({