test(app): browser checks for R1 and D6b

editor-deselect.spec.ts: « Désélectionner » (live region, row focus, document unchanged after reload); Escape by place (canvas, field, delete dialog, references, tracing); mouse empty clicks, selecting, selected point and zone kept; zoom/pan/drag/Ctrl+wheel kept; typed value applied by the deselecting click; touch with a capture recorder; read-only twin at 375 px. editor-equine.spec.ts: empty click on the horse drawing deselects.

Touch guards reached: taps on empty (also 40 px above a zone, 36 px above the box bottom): primary down/up, one click on no annotation, deselect at click. Tap 6 px outside a marker: click target is the marker, it ends selected, no announcement. One-finger drag: no click (twin: pointercancel). Two-finger tap and pinch: non-primary pointerdown seen, 2 pointerups, no click.
This commit is contained in:
bchanot committed 2026-11-12 13:04:03 +01:00
1 parent a1ee194725
commit ab823f4191
2 files changed
+722

No files matched your search

+41
View File
@@ -13,6 +13,7 @@ import { dropLateReplays, routeToSandbox } from '../support/sandbox'
import {
place,
type Actor,
annotationList,
closeReferences,
editorActor,
openEditor,
@@ -20,6 +21,7 @@ import {
openSection,
SECTIONS,
seedDraft,
selectionTag,
selectTab,
serverDocument,
showDrawing,
@@ -304,6 +306,45 @@ test.describe('equine working copy and commit latency', () => {
expect(errors, 'page errors on the equine copy').toEqual([])
})
test('an empty click on the horse drawing deselects the annotation (D6b)', async ({
page,
requests,
}) => {
test.setTimeout(120_000)
expect(copyId).not.toBe('')
requests.forbid(actor.account.email, actor.account.password)
await signIn(page, actor.account, dict)
await page.goto('/app/admin')
await stepUpAdmin(page, dict, actor.secret)
await page.goto(`/app/admin/sheets/${copyId}/draft`)
await expect(toolButton(page, dict, 'point')).toBeEnabled()
await showDrawing(page, dict)
await annotationList(page, dict).getByRole('button').first().click()
await expect(selectionTag(page)).toBeVisible()
// A horse path no annotation covers: its box centre hits the path itself.
const at = await page
.getByTestId('annotation-canvas')
.evaluate((canvas) => {
const paths = canvas.querySelectorAll('path')
for (const path of paths) {
if (path.closest('[data-anno-id]')) continue
const r = path.getBoundingClientRect()
const x = r.x + r.width / 2
const y = r.y + r.height / 2
if (document.elementFromPoint(x, y) !== path) continue
return { x, y }
}
return null
})
expect(
at,
'a horse path with no annotation under its centre',
).not.toBeNull()
await page.mouse.click(at!.x, at!.y)
await expect(selectionTag(page)).toHaveCount(0)
await expect(page.getByTestId('annotation-overview')).toBeVisible()
})
test('commit latency on the equine copy', async ({ page, requests }) => {
test.setTimeout(180_000)
expect(copyId).not.toBe('')