test(app): « Plus » Escape in the R1 browser checks

This commit is contained in:
bchanot committed 2026-11-12 13:05:43 +01:00
1 parent ab823f4191
commit 2327d61d8e
1 file changed
+38
@@ -678,4 +678,42 @@ test.describe('deselect and D6b (read-only twin at 375 px)', () => {
await report('twin two-finger tap')
expect(saves).toEqual([])
})
test('Escape closes « Plus » first, then deselects the twin', async ({
page,
context,
requests,
}) => {
const { actor, saves } = await open(page, false)
requests.forbid(actor.account.email, actor.account.password)
await selectTab(page, dict, 'annotations')
const canvas = page.getByTestId('catalogue-canvas')
await expect(canvas).toBeVisible()
const cdp = await context.newCDPSession(page)
await canvas.scrollIntoViewIfNeeded()
const marker = await page
.getByTestId('catalogue-canvas-drawing')
.locator('[data-anno-id="pt-a"]')
.first()
.boundingBox()
await tap(cdp, {
x: marker!.x + marker!.width / 2,
y: marker!.y + marker!.height / 2,
})
await expect(selectionTag(page)).toContainText(POINT)
const more = page.locator('#editor-tabs-more-button')
await more.click()
await expect(more).toHaveAttribute('aria-expanded', 'true')
await canvas.focus()
await page.keyboard.press('Escape')
await expect(more).toHaveAttribute('aria-expanded', 'false')
await expect(more).toBeFocused()
await expectKept(page, POINT)
await page.keyboard.press('Escape')
await expectDeselected(page)
await expect(liveRegion(page)).toHaveCount(1)
expect(saves).toEqual([])
})
})