fix(editor): dialog trigger for references, Task 11 review minors

This commit is contained in:
bchanot committed 2026-11-15 16:25:32 +01:00
1 parent da755f9768
commit d9dbcf1609
11 files changed
+47 -59

No files matched your search

+27 -3
View File
@@ -141,7 +141,8 @@ test.describe('references dialog, view mode', () => {
const { actor, seed } = await open(page)
requests.forbid(actor.account.email, actor.account.password)
await openCitations(page, dict, 'Constat A')
await expect(trigger(page)).toHaveAttribute('aria-expanded', 'true')
await expect(trigger(page)).toHaveAttribute('aria-haspopup', 'dialog')
await expect(trigger(page)).not.toHaveAttribute('aria-expanded')
await expect(
citationsDialog(page).getByRole('heading', { level: 2 }),
).toHaveText(dict['editor.references.dialog_title'])
@@ -217,6 +218,30 @@ test.describe('references dialog, view mode', () => {
await expect(trigger(page)).toBeFocused()
})
test('a family: « Tout afficher » filters the library by it, Back returns to its dialog', async ({
page,
}) => {
test.setTimeout(150_000)
await open(page)
await openCitations(page, dict, 'Dysfonction A')
await link(page).click()
await expectNoDialog(page)
const root = libraryRoot(page)
await expect(
root.locator('button[aria-controls][id$="-header"]'),
).toHaveCount(1)
await expect(root.getByRole('button', { name: /Source B/ })).toBeVisible()
await expect(root.getByTestId('editor-references-filter')).toContainText(
'Dysfonction A',
)
await page.goBack()
await expect(page.locator('dialog[open]')).toHaveCount(2)
await expect(panel(page)).toContainText('Zone A › Dysfonction A')
await expect(
findingDialog(page).getByRole('heading', { name: 'Dysfonction A' }),
).toBeVisible()
})
test('a long list scrolls inside the dialog; « 0 référence » opens the empty one', async ({
page,
}) => {
@@ -380,7 +405,6 @@ for (const reduced of [false, true]) {
await openCitations(page, dict, 'Constat A')
await closeCitations(page, dict)
await expect(trigger(page)).toBeFocused()
await expect(trigger(page)).toHaveAttribute('aria-expanded', 'false')
await showCitations(page)
await page.keyboard.press('Escape')
await expect(panel(page)).toHaveCount(0)
@@ -534,7 +558,7 @@ test.describe('references dialog, read-only at 375 px', () => {
// A tile opens by a tap; the finding dialog's controls underneath stay as they were.
await tap(heads(page).first())
await expect(heads(page).first()).toHaveAttribute('aria-expanded', 'true')
await expect(trigger(page)).toHaveAttribute('aria-expanded', 'true')
await expect(citationsDialog(page)).toBeVisible()
// Its ✕ closes it only; the trigger holds the focus.
await tap(
citationsDialog(page).getByRole('button', { name: dict['common.close'] }),