fix(editor): Task 3 round 1, literal journey, pin, limits, notice

This commit is contained in:
bchanot committed 2026-11-13 20:38:04 +01:00
1 parent 8b42816270
commit 3bb3603115
9 files changed
+295 -97

No files matched your search

@@ -14,6 +14,7 @@ import {
place,
referenceDialog,
referenceSettled,
revealFinding,
seedDraft,
showCitations,
standardShape,
@@ -33,6 +34,8 @@ const chip = (page: Page) =>
libraryRoot(page).getByTestId('editor-references-filter')
const headers = (page: Page) =>
libraryRoot(page).locator('button[aria-controls][id$="-header"]')
const sheetHeaders = (page: Page) =>
panel(page).locator('button[aria-controls][id$="-header"]')
const undo = (page: Page) => historyButton(page, dict, 'undo')
const dialogs = (page: Page) => page.locator('dialog[open]')
@@ -107,6 +110,46 @@ test.describe('the owner journey through the history', () => {
await dropLateReplays(context)
})
test("the owner's eight steps, nothing in between: Back returns to finding A with its sheet open", async ({
page,
}) => {
test.setTimeout(240_000)
await open(page)
// 1. the Constats tab; 2. finding A opens.
await openTab(page, dict, 'findings')
await (await revealFinding(page, 'Constat A')).click()
await expect(findingDialog(page)).toBeVisible()
await entryHolds(page, 'view.finding !== null')
// 3. « 2 références »; 4. the sheet opens and lists the two references.
const trigger = page.locator('[data-citations-trigger]:visible')
await expect(trigger).toContainText('2 références')
await trigger.click()
await expect(place(page, 'citations')).toBeVisible()
await expect(sheetHeaders(page)).toHaveCount(2)
await entryHolds(page, 'view.finding && view.finding.citations')
// 5. « Tout afficher dans l'onglet Références »; 6. the tab filtered on A's two references.
await panel(page)
.getByRole('button', { name: dict['editor.references.panel_show_all'] })
.click()
await expectNoDialog(page)
await entryHolds(
page,
"view.tab === 'references' && !!view.referenceFilter",
)
await expect(chip(page)).toContainText('Constat A')
await expect(headers(page)).toHaveCount(2)
await expect(
libraryRoot(page).getByText('2 références', { exact: true }),
).toBeVisible()
// 7. browser Back; 8. finding A with its sheet on top, as left.
await page.goBack()
await expect(dialogs(page)).toHaveCount(2)
await expect(findingDialog(page)).toBeVisible()
await expect(findingDialog(page)).toContainText('Constat A')
expect(await sheetOnTop(page)).toBe(true)
await expect(sheetHeaders(page)).toHaveCount(2)
})
test('eight steps: finding, sheet, filter, edit, Back, Forward, Revenir au constat, every Back', async ({
page,
}, info) => {