feat(editor): sheet landings, history and e2e for the finding layers
« Tout afficher » clears the search and keeps the sort. A landing waits for the dialogs a move closed and for their focus restore. Helpers and shell specs move to the dialog and sheet flow; new finding dialog spec (entries, guards, flip, gone rule, Back and Forward over the layers).
This commit is contained in:
1 parent
18085cecf8
commit
4731a3376a
21 files changed
+782
-474
No files matched your search
@@ -5,6 +5,7 @@ import { dropLateReplays, routeToSandbox } from '../support/sandbox'
|
||||
import {
|
||||
clientOf,
|
||||
closeCitations,
|
||||
closeFinding,
|
||||
copyKeyOf,
|
||||
editorActor,
|
||||
geometryField,
|
||||
@@ -168,7 +169,7 @@ test.describe('editor shell, width crossing (H)', () => {
|
||||
expect(ids).toEqual([])
|
||||
})
|
||||
|
||||
test('the findings creation form and the submission note keep their typed text', async ({
|
||||
test('the findings creation form stays in its dialog while narrow: draft, focus and a notice kept', async ({
|
||||
page,
|
||||
}) => {
|
||||
await open(page)
|
||||
@@ -176,12 +177,36 @@ test.describe('editor shell, width crossing (H)', () => {
|
||||
await page
|
||||
.getByRole('button', { name: dict['editor.findings.add_zone'] })
|
||||
.click()
|
||||
await keepsTypedValue(
|
||||
page,
|
||||
page.locator('#finding-new-name-fr'),
|
||||
dict['editor.findings.add_zone'],
|
||||
'findings',
|
||||
)
|
||||
const field = page.locator('#finding-new-name-fr')
|
||||
await field.fill('Saisie')
|
||||
await expect(field).toBeFocused()
|
||||
// The dialog is a part the flip keeps: no edit control leaves, nothing is written.
|
||||
await page.setViewportSize(NARROW)
|
||||
await expect(field).toBeVisible()
|
||||
await expect(field).toHaveAttribute('readonly', '')
|
||||
await expect(field).toHaveAttribute('aria-readonly', 'true')
|
||||
await expect(field).toHaveValue('Saisie')
|
||||
await expect(field).toBeFocused()
|
||||
await expect(
|
||||
page.getByText(dict['editor.findings.flip_narrow']),
|
||||
).toBeVisible()
|
||||
await expect(
|
||||
page.getByRole('button', { name: dict['editor.findings.create'] }),
|
||||
).toBeDisabled()
|
||||
await page.setViewportSize(WIDE)
|
||||
await expect(field).not.toHaveAttribute('readonly', '')
|
||||
await expect(field).toHaveValue('Saisie')
|
||||
await expect(field).toBeFocused()
|
||||
await expect(saveLine(page)).not.toHaveText(UNSAVED_LINE)
|
||||
await page.keyboard.press('Escape')
|
||||
await page
|
||||
.getByRole('button', { name: dict['editor.findings.discard'] })
|
||||
.click()
|
||||
await expect(dialogs(page)).toHaveCount(0)
|
||||
})
|
||||
|
||||
test('the submission note keeps its typed text', async ({ page }) => {
|
||||
await open(page)
|
||||
await selectTab(page, dict, 'verification')
|
||||
await keepsTypedValue(
|
||||
page,
|
||||
@@ -262,21 +287,22 @@ test.describe('editor shell, width crossing (H)', () => {
|
||||
await expect(saveLine(page)).toHaveText(UNSAVED_LINE)
|
||||
})
|
||||
|
||||
test('the citations panel open: read-only below the threshold, unsaved work kept, edit back on widening', async ({
|
||||
test('the citations sheet open: read-only below the threshold, unsaved work kept, edit back on widening', async ({
|
||||
page,
|
||||
}) => {
|
||||
await open(page)
|
||||
await commitName(page, 'Nom conservé')
|
||||
await openCitations(page, dict, 'Constat A')
|
||||
await cross(page, NARROW)
|
||||
await expectReadOnly(page)
|
||||
await page.setViewportSize(NARROW)
|
||||
await expect(place(page, 'citations')).toBeVisible()
|
||||
await expect(page.locator('dialog[open]')).toHaveCount(2)
|
||||
await page.setViewportSize(WIDE)
|
||||
await closeCitations(page, dict)
|
||||
await closeFinding(page, dict)
|
||||
await expect(saveLine(page)).toHaveText(UNSAVED_LINE)
|
||||
await cross(page, WIDE)
|
||||
await expect(
|
||||
page.getByRole('button', { name: dict['common.save'], exact: true }),
|
||||
).toBeEnabled()
|
||||
await closeCitations(page, dict)
|
||||
})
|
||||
|
||||
test('text typed without a blur is unsaved after the crossing and the copy is written', async ({
|
||||
|
||||
Reference in new issue
Block a user