test(tests): press the drawing where the sticky strip leaves it visible

The strip made sticky in f2809f20 covers the drawing's top band and the
aside's top while the page is scrolled (rev 4 point 1 ruling, accepted
cost). Three presses and one axe scan ran at that scroll after a row
click: back to the top first, and assert the press hits the drawing.
This commit is contained in:
bchanot committed 2026-11-19 14:43:19 +01:00
1 parent 05a8525455
commit de418b29a9
2 files changed
+23

No files matched your search

@@ -20,6 +20,7 @@ import {
reloadAccepting,
revisionText,
saveLine,
scrollToTop,
seedDraft,
selectionTag,
selectTab,
@@ -140,6 +141,18 @@ async function expectDeselected(page: Page) {
await expect(overview(page)).toBeVisible()
}
/** The client point hits the canvas box, not the sticky strip or bar over it. */
async function expectOnDrawing(page: Page, at: { x: number; y: number }) {
const hit = await page.evaluate(
({ x, y }) =>
document
.elementFromPoint(x, y)
?.closest('[data-testid="annotation-canvas"]') != null,
at,
)
expect(hit, `${at.x}, ${at.y} lands on the drawing`).toBe(true)
}
/** A negative check: the state is still there after two animation frames. */
async function expectKept(page: Page, name: string) {
await frames(page)
@@ -292,6 +305,9 @@ test.describe('deselect and D6b (editor, mouse and keyboard)', () => {
requests.forbid(actor.account.email, actor.account.password)
await select(page, POINT)
for (const at of [IN_CIRCLE, IN_RECT, IN_ROOT]) {
// The row click scrolled the page: the drawing's top band is under the sticky strip.
await scrollToTop(page)
await expectOnDrawing(page, await clientOf(page, at.x, at.y))
await clickAt(page, at)
await expectDeselected(page)
await select(page, POINT)
@@ -624,9 +640,11 @@ test.describe('deselect and D6b (touch, editor at 1 280 px)', () => {
// b. Empty drawing, a zone about 40 px below the tap.
await select(page, POINT)
await scrollToTop(page)
await takeRecord(page)
const top = await clientOf(page, 175, 100)
const above = { x: top.x, y: top.y - 40 }
await expectOnDrawing(page, above)
expect(await annotationUnder(page, above)).toBeNull()
await tap(cdp, above)
await expectDeselected(page)
@@ -26,6 +26,7 @@ import {
savedLine,
saveDraft,
saveLine,
scrollToTop,
closeSecondSession,
secondSession,
selectionTag,
@@ -255,6 +256,8 @@ async function modifyAnnotations(page: Page) {
*/
async function repairGeometry(page: Page) {
await toolButton(page, dict, 'point').click()
// The last row click scrolled the page: the drawing's top edge is under the sticky strip.
await scrollToTop(page)
// On this 200 x 150 drawing the core keeps a shrunk marker at 1 unit from the edge: the
// proposal of a corrected position needs a click on the edge itself (editor-geometry
// covers it on a 1 000-unit drawing). Here the click is placed at once.
@@ -334,6 +337,8 @@ test.describe('editor journey (owner trial steps)', () => {
await historyButton(page, dict, 'undo').click()
await historyButton(page, dict, 'redo').click()
const modified = await modifyAnnotations(page)
// At rest: scrolled, the stuck strip covers part of the aside's targets (axe target-size).
await scrollToTop(page)
await expectAccessible(page, 'the editor with annotations')
await saveDraft(page, dict, 1)
const draftId = await sql(