fix(editor): deletion undo and Back, Plus focus to the panel

This commit is contained in:
bchanot committed 2026-11-14 14:24:06 +01:00
1 parent 270444e2ec
commit 085c56877c
14 files changed
+252 -18

No files matched your search

@@ -225,6 +225,31 @@ test.describe('finding dialog', () => {
await expect(parent).toHaveAttribute('aria-selected', 'true')
})
test('after a deletion the first Back moves and one « Défaire » restores the row', async ({
page,
}) => {
test.setTimeout(150_000)
await open(page)
await openFinding(page, dict, 'Constat A')
await inDialog(page, dict['editor.action.delete']).click()
await page
.locator('dialog[open]')
.last()
.getByRole('button', { name: dict['editor.delete.confirm'] })
.click()
await expectNoDialog(page)
await layerWritten(page, 'none')
await undo(page).click()
const row = page.getByRole('treeitem', { name: /Constat A/ })
await expect(row).toBeVisible()
await expect(row).toHaveAttribute('aria-selected', 'true')
await expect(row).toBeFocused()
await page.goBack()
await expect(page.getByRole('tab', { selected: true })).toHaveText(
new RegExp(`^${dict['editor.tab.annotations']}`),
)
})
test('a creation is a layer: « Créer » shows the new element, a Back goes to the tree', async ({
page,
}) => {
@@ -110,6 +110,20 @@ test.describe('« Plus » dropdown', () => {
await expect(list(page)).toHaveCount(0)
await expect(more(page)).toHaveAttribute('aria-expanded', 'false')
})
test('Enter on an entry focuses the panel of that tab', async ({ page }) => {
await openAt(page, 375)
await more(page).click()
await list(page)
.getByRole('button', { name: dict['editor.tab.findings'] })
.focus()
await page.keyboard.press('Enter')
await expect(list(page)).toHaveCount(0)
const panel = page.getByRole('tabpanel', {
name: dict['editor.tab.findings'],
})
await expect(panel).toBeFocused()
})
})
test.describe('the sidebar stays fixed', () => {