fix(editor): a press on a held redo keeps the pending work untouched

This commit is contained in:
bchanot committed 2026-11-19 14:02:11 +01:00
1 parent 00e995a6cb
commit 8f036b2a8a
3 files changed
+76

No files matched your search

@@ -247,6 +247,39 @@ test.describe('editor annotations (A3)', () => {
await expect(page.getByTestId('gesture-message')).toHaveCount(1)
})
test('a mouse click on « Refaire » during an arrow series says why and keeps the focus', async ({
page,
requests,
}) => {
const { actor } = await openAnnotations(page)
requests.forbid(actor.account.email, actor.account.password)
await tool(page, 'point').click()
await clickDrawing(page, 300, 300)
await fillCreation(page, { fr: 'Point un', en: 'Point one' })
await createFromPanel(page)
const handle = page.getByRole('button', {
name: 'Point Point un',
exact: true,
})
await handle.focus()
await page.keyboard.press('ArrowRight')
const redo = historyButton(page, dict, 'redo')
await expect(redo).toHaveAccessibleDescription(
dict['editor.history.hold_pending'],
)
// Playwright refuses to click an aria-disabled button: scroll it clear of the sticky
// bar, then press it by force (the mouse events are real).
await redo.evaluate((el) => el.scrollIntoView({ block: 'center' }))
await redo.click({ force: true })
await expect(page.getByTestId('gesture-line')).toContainText(
dict['editor.history.hold_pending'],
)
await expect(handle).toBeFocused()
await expect(redo).toHaveAccessibleDescription(
dict['editor.history.hold_pending'],
)
})
test('a click with jitter never moves; a drag moves by the pointer delta', async ({
page,
requests,