feat(editor): header history, save line and Abandonner les modifications
Header Annuler/Retablir on every tab (aria-disabled, commit on pointerdown, refused blur commit skips the undo). Save line: unsaved count selector (savedDistance), saveLineState forms, server save time via readSaveTime (lastSave in the store, never the browser clock). Discard relabelled and names the stored copy. Tool column pair removed, glyphs in EditorGlyph. Rewritten or removed assertions (R-24): - editor-route.test: Revision 3 / unsaved text / Annuler les modifications -> save-line testid, Abandonner label, copy sentence in the dialog - editor-route-conflict, editor-route-recovery: Revision n and copy_cap/ copy_quota text queries -> save-line testid - editor-no-loss: discard button label - editor-annotations-tab: tool column undo/redo test -> no pair left (behaviour moved to editor-history-buttons.test) - e2e journey/annotations/recovery/structures/support saveDraft/lan: undo/redo and revision/unsaved text -> historyButton, saveLine helpers; structures toHaveCount(0) on old text -> exact Revision n line - editor-shell clickability: header Annuler/Retablir added
This commit is contained in:
1 parent
ab51ea764d
commit
99b669bf8f
29 files changed
+1397
-248
No files matched your search
@@ -3,10 +3,12 @@ import type { Page, TestInfo } from '@playwright/test'
|
||||
import { expect, expectAccessible, test } from '../support/browser'
|
||||
import { dropLateReplays, routeToSandbox } from '../support/sandbox'
|
||||
import {
|
||||
clientOf,
|
||||
clickDrawing,
|
||||
clientOf,
|
||||
editorActor,
|
||||
geometryField,
|
||||
historyButton,
|
||||
pressAtBox,
|
||||
openEditor,
|
||||
pickAnnotation,
|
||||
saveDraft,
|
||||
@@ -128,12 +130,7 @@ test.describe('editor annotations (A3)', () => {
|
||||
await fillCreation(page, { fr: 'Accès un', en: 'Access one' }, 'detail-a')
|
||||
await createFromPanel(page)
|
||||
await expect(selectionTag(page)).toContainText('Accès un')
|
||||
await expect(
|
||||
page.getByRole('button', {
|
||||
name: dict['editor.annotations.undo'],
|
||||
exact: true,
|
||||
}),
|
||||
).toBeEnabled()
|
||||
await expect(historyButton(page, dict, 'undo')).toBeEnabled()
|
||||
|
||||
// A numeric edit of the point, then undo and redo.
|
||||
await pickAnnotation(page, dict, /Point un/)
|
||||
@@ -141,19 +138,12 @@ test.describe('editor annotations (A3)', () => {
|
||||
await cx.fill('420')
|
||||
await cx.press('Enter')
|
||||
await expect(cx).toHaveValue('420')
|
||||
await page
|
||||
.getByRole('button', {
|
||||
name: dict['editor.annotations.undo'],
|
||||
exact: true,
|
||||
})
|
||||
.click()
|
||||
await historyButton(page, dict, 'undo').click()
|
||||
await expect(geometryField(page, dict, 'cx')).toHaveValue(placed)
|
||||
await page
|
||||
.getByRole('button', {
|
||||
name: dict['editor.annotations.redo'],
|
||||
exact: true,
|
||||
})
|
||||
.click()
|
||||
await historyButton(page, dict, 'redo').click()
|
||||
await expect(geometryField(page, dict, 'cx')).toHaveValue('420')
|
||||
// Nothing left to redo: the button is aria-disabled and a press changes nothing.
|
||||
await pressAtBox(page, historyButton(page, dict, 'redo'))
|
||||
await expect(geometryField(page, dict, 'cx')).toHaveValue('420')
|
||||
|
||||
await saveDraft(page, dict, seed.revision + 1)
|
||||
|
||||
Reference in new issue
Block a user