diff --git a/apps/app/e2e/shell/editor-citations.spec.ts b/apps/app/e2e/shell/editor-citations.spec.ts index 73adee2a..e066293b 100644 --- a/apps/app/e2e/shell/editor-citations.spec.ts +++ b/apps/app/e2e/shell/editor-citations.spec.ts @@ -533,6 +533,42 @@ test.describe('references dialog, edit mode', () => { ) }) + test('by keyboard: choose, « Citer », « Enregistrer », one « Défaire » restores', async ({ + page, + }) => { + test.setTimeout(150_000) + const { seed } = await open(page) + await editCitations(page) + await citeSelect(page).focus() + await page.keyboard.press('ArrowDown') + const chosen = await citeSelect(page).inputValue() + expect(chosen).not.toBe('') + await page.keyboard.press('Tab') + const cite = inDialog(page, dict['editor.citations.cite']) + await expect(cite).toBeFocused() + await page.keyboard.press('Enter') + await expect(draftRows(page)).toHaveCount(4) + await inDialog(page, dict['editor.findings.save']).focus() + await page.keyboard.press('Enter') + await expect(editButton(page)).toBeFocused() + await closeCitations(page, dict) + await closeFinding(page, dict) + await saveDraft(page, dict, seed.revision + 1) + let saved = await serverDocument>(seed.draftId) + expect(nodeOf(saved).reference_ids).toEqual([ + 'ref-a', + 'ref-b', + 'ref-c', + chosen, + ]) + const undo = historyButton(page, dict, 'undo') + await undo.click() + await expect(undo).toHaveAttribute('aria-disabled', 'true') + await saveDraft(page, dict, seed.revision + 2) + saved = await serverDocument>(seed.draftId) + expect(nodeOf(saved).reference_ids).toEqual(['ref-a', 'ref-b', 'ref-c']) + }) + test('the ✕ is a 44 px box beside a long title at 1280 px', async ({ page, }) => {