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
@@ -7,6 +7,7 @@ import {
|
||||
copyKeyOf,
|
||||
storedCopy,
|
||||
closeCitations,
|
||||
closeFinding,
|
||||
editorActor,
|
||||
openEditor,
|
||||
openCitations,
|
||||
@@ -121,10 +122,11 @@ test.describe('editor shell, kept places (B2a)', () => {
|
||||
})
|
||||
expect(repeated).toEqual([])
|
||||
await closeCitations(page, dict)
|
||||
await closeFinding(page, dict)
|
||||
})
|
||||
|
||||
for (const width of [1024, 1280]) {
|
||||
test(`the open citations panel leaves the header and the tab row clickable at ${width} px`, async ({
|
||||
test(`the open citations sheet is modal: the header and the tab row are out of reach at ${width} px`, async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.setViewportSize({ width, height: 800 })
|
||||
@@ -140,29 +142,20 @@ test.describe('editor shell, kept places (B2a)', () => {
|
||||
.getByRole('button', { name: dict['editor.reference.add'] })
|
||||
.click()
|
||||
await openCitations(page, dict, 'Constat A')
|
||||
const header = page.locator('main header').first()
|
||||
const tabs = page.getByRole('tablist')
|
||||
const panel = place(page, 'citations')
|
||||
const targets = [
|
||||
page.getByRole('button', { name: dict['common.save'], exact: true }),
|
||||
page.getByRole('tab', {
|
||||
name: new RegExp(`^${dict['editor.tab.findings']}`),
|
||||
}),
|
||||
historyButton(page, dict, 'undo'),
|
||||
]
|
||||
for (const scrolled of [false, true]) {
|
||||
await page.evaluate((y) => window.scrollTo(0, y), scrolled ? 400 : 0)
|
||||
for (const target of targets) await target.click({ trial: true })
|
||||
// « Défaire » / « Refaire » may be aria-disabled (a trial click would wait).
|
||||
for (const kind of ['undo', 'redo'] as const) {
|
||||
const button = historyButton(page, dict, kind)
|
||||
await button.scrollIntoViewIfNeeded()
|
||||
expect(await hitsItself(button)).toBe(true)
|
||||
}
|
||||
const box = await panel.boundingBox()
|
||||
for (const above of [header, tabs]) {
|
||||
const other = await above.boundingBox()
|
||||
expect(box!.y).toBeGreaterThanOrEqual(other!.y + other!.height - 1)
|
||||
}
|
||||
for (const target of targets) {
|
||||
expect(await hitsItself(target)).toBe(false)
|
||||
}
|
||||
await closeCitations(page, dict)
|
||||
await closeFinding(page, dict)
|
||||
for (const target of targets) {
|
||||
expect(await hitsItself(target)).toBe(true)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user