feat(editor): « Aller à » opens the finding dialog, spec races fixed

« Aller à » a finding shows its row and opens its dialog in view mode.
E2e helpers wait for the history to settle after a layer or section
pop; the layout walk waits out the write budget. Label rows for the
nine new keys.
This commit is contained in:
bchanot committed 2026-11-13 19:23:48 +01:00
1 parent 4731a3376a
commit c893dec60b
10 files changed
+89 -3

No files matched your search

+8 -2
View File
@@ -434,7 +434,7 @@ for (const reduced of [false, true]) {
await expect(page.locator('dialog[open]')).toHaveCount(2)
})
test('« Tout afficher » and « Aller à » land where the pending move says', async ({
test('« Tout afficher » and « Aller à » land where the move says', async ({
page,
}) => {
test.setTimeout(150_000)
@@ -450,7 +450,13 @@ for (const reduced of [false, true]) {
.getByRole('button', { name: dict['editor.references.go_to'] })
.first()
.click()
await expectNoDialog(page)
// The sheet closes and the family opens in the dialog (view mode); closed, the
// row holds the focus.
await expect(place(page, 'citations')).toHaveCount(0)
await expect(
findingDialog(page).getByRole('heading', { name: 'Dysfonction A' }),
).toBeVisible()
await closeFinding(page, dict)
await expect(
page.getByRole('treeitem', { name: /Dysfonction A/ }),
).toBeFocused()
@@ -13,6 +13,7 @@ import {
openEditor,
expectNoDialog,
findingDialog,
layersSettled,
openCitations,
pickAnnotation,
place,
@@ -234,6 +235,7 @@ test.describe('deselect and D6b (editor, mouse and keyboard)', () => {
await expect(findingDialog(page)).toBeVisible()
await page.keyboard.press('Escape')
await expectNoDialog(page)
await layersSettled(page)
await selectTab(page, dict, 'annotations')
await expectKept(page, POINT)
await box(page).focus()
@@ -200,6 +200,7 @@ test.describe('editor shell, width crossing (H)', () => {
await expect(saveLine(page)).not.toHaveText(UNSAVED_LINE)
await page.keyboard.press('Escape')
await page
.locator('dialog[open]')
.getByRole('button', { name: dict['editor.findings.discard'] })
.click()
await expect(dialogs(page)).toHaveCount(0)
@@ -4,8 +4,10 @@ import { expect, test } from '../support/browser'
import { dropLateReplays, routeToSandbox } from '../support/sandbox'
import {
TABS,
closeFinding,
draftTitle,
editorActor,
findingDialog,
historyButton,
openEditor,
place,
@@ -239,6 +241,16 @@ test.describe('editor shell journeys (H)', () => {
await selectTab(page, dict, 'verification')
await goTo('Constat A')
await expect(place(page, 'findings')).toBeVisible()
// The finding opens in its dialog, in view mode; closed, its row holds the focus.
await expect(
findingDialog(page).getByRole('heading', { name: 'Constat A' }),
).toBeVisible()
await expect(
findingDialog(page).getByRole('button', {
name: dict['editor.findings.edit'],
}),
).toBeVisible()
await closeFinding(page, dict)
await expect(place(page, 'findings').locator(':focus')).toHaveCount(1)
await selectTab(page, dict, 'verification')
@@ -15,6 +15,7 @@ import {
closeFinding,
draftPath,
expectNoDialog,
layersSettled,
draftTitle,
editorActor,
historyButton,
@@ -146,6 +147,9 @@ test.describe('editor shell layout (H)', () => {
await expectNoHorizontalOverflow(page, `the sheet at ${width} px`)
await closeCitations(page, dict)
await closeFinding(page, dict)
// The walk is a script: about 20 history entries per width would pass the adapter's
// write budget (40 pushes in 10 s) over four widths. A person never does.
await page.waitForTimeout(4_000)
}
})
@@ -223,8 +227,10 @@ test.describe('editor shell layout (H)', () => {
})
await openCitations(page, dict, 'Constat A')
await page.keyboard.press('Escape')
await expect(place(page, 'citations')).toHaveCount(0)
await page.keyboard.press('Escape')
await expectNoDialog(page)
await layersSettled(page)
await selectTab(page, dict, 'annotations')
await expect(place(page, 'citations')).toHaveCount(0)
await expect(page.getByTestId('annotation-canvas')).toBeVisible()
@@ -382,8 +388,10 @@ test.describe('editor shell keyboard order (H)', () => {
}
expect(met.has('panel')).toBe(true)
await page.keyboard.press('Escape')
await expect(place(page, 'citations')).toHaveCount(0)
await page.keyboard.press('Escape')
await expectNoDialog(page)
await layersSettled(page)
await selectTab(page, dict, 'annotations')
const after = await walk(page, 'side')
expect(after.slice(0, 3)).toEqual(['tab', 'undo', 'redo'])
@@ -326,6 +326,7 @@ test.describe('editor structures (A4)', () => {
).toBeVisible()
await deleteDialog(page)
.getByRole('button', { name: dict['editor.delete.close'], exact: true })
.last()
.click()
await expect(page.locator('dialog[open]')).toHaveCount(1)
await closeFinding(page, dict)