feat(editor): say why redo is unavailable during pending work

This commit is contained in:
bchanot committed 2026-11-19 12:38:26 +01:00
1 parent e341f03390
commit 00e995a6cb
7 files changed
+216 -21

No files matched your search

@@ -222,6 +222,31 @@ test.describe('editor annotations (A3)', () => {
).toBe('zone-a')
})
test('a held « Refaire » says why: description on focus, message on press, nothing moves', async ({
page,
requests,
}) => {
const { actor } = await openAnnotations(page)
requests.forbid(actor.account.email, actor.account.password)
const reason = dict['editor.history.hold_creation']
// A zone tracing is a creation with no modal dialog: the header stays reachable.
await tool(page, 'zone').click()
await clickDrawing(page, 600, 200)
const redo = historyButton(page, dict, 'redo')
await redo.focus()
await expect(redo).toHaveAttribute('aria-disabled', 'true')
await expect(redo).toHaveAccessibleDescription(reason)
await expect(historyButton(page, dict, 'undo')).toHaveAccessibleDescription(
reason,
)
await expectAccessible(page, 'a held « Refaire » during a creation')
await expectNoShift(page, async () => {
await pressAtBox(page, redo)
await expect(page.getByTestId('gesture-line')).toContainText(reason)
})
await expect(page.getByTestId('gesture-message')).toHaveCount(1)
})
test('a click with jitter never moves; a drag moves by the pointer delta', async ({
page,
requests,