test(editor): reference dialog, filter and the owner journey, specs follow the dialog
This commit is contained in:
1 parent
7a64daf251
commit
8b42816270
20 files changed
+1546
-1171
No files matched your search
@@ -3,6 +3,7 @@ import type { Locator, Page, TestInfo } from '@playwright/test'
|
||||
import { expect, expectAccessible, test } from '../support/browser'
|
||||
import { dropLateReplays, routeToSandbox } from '../support/sandbox'
|
||||
import {
|
||||
addReference,
|
||||
bareShape,
|
||||
closeFinding,
|
||||
editorActor,
|
||||
@@ -85,17 +86,10 @@ test.describe('editor structures (A4)', () => {
|
||||
// « Référence A » stays first: it is cited by « Constat A »).
|
||||
await openTab(page, dict, 'references')
|
||||
for (const citation of ['Première référence', 'Seconde référence']) {
|
||||
await page
|
||||
.getByRole('button', { name: dict['editor.references.add'] })
|
||||
.click()
|
||||
await page.locator('#tab-reference-new-type').selectOption('book')
|
||||
await page.locator('#tab-reference-new-citation').fill(citation)
|
||||
await page
|
||||
.getByRole('button', { name: dict['editor.reference.add'] })
|
||||
.click()
|
||||
await addReference(page, dict, citation)
|
||||
await expect(
|
||||
page.getByRole('button', { name: new RegExp(`^${citation}`) }),
|
||||
).toBeFocused()
|
||||
).toBeVisible()
|
||||
}
|
||||
const tiles = page.locator('[id^="tab-reference-"][id$="-header"]')
|
||||
const tileOf = (citation: string) =>
|
||||
@@ -112,17 +106,13 @@ test.describe('editor structures (A4)', () => {
|
||||
await expect(tiles).toHaveCount(1)
|
||||
await search.fill('')
|
||||
await expect(tiles).toHaveCount(3)
|
||||
// An added tile stays open (P24): no click, a click would close it.
|
||||
await expect(
|
||||
tiles.filter({ hasText: 'Seconde référence' }),
|
||||
).toHaveAttribute('aria-expanded', 'true')
|
||||
// An added tile is closed (the list does not move, R2F-5): open it, then move it.
|
||||
await tiles.filter({ hasText: 'Seconde référence' }).click()
|
||||
await tileOf('Seconde référence')
|
||||
.getByRole('button', { name: dict['editor.action.move_up'] })
|
||||
.click()
|
||||
await expect(tiles.nth(1)).toContainText('Seconde référence')
|
||||
await expect(
|
||||
tiles.filter({ hasText: 'Première référence' }),
|
||||
).toHaveAttribute('aria-expanded', 'true')
|
||||
await tiles.filter({ hasText: 'Première référence' }).click()
|
||||
await tileOf('Première référence')
|
||||
.getByRole('button', { name: dict['editor.action.delete'] })
|
||||
.click()
|
||||
|
||||
Reference in new issue
Block a user