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
@@ -5,24 +5,29 @@ import { stepUpAdmin } from '../support/admin'
|
||||
import { expect, expectAccessible, test } from '../support/browser'
|
||||
import { dropLateReplays, routeToSandbox } from '../support/sandbox'
|
||||
import {
|
||||
pickAnnotation,
|
||||
selectionTag,
|
||||
clickDrawing,
|
||||
createFromPanel,
|
||||
creationPanel,
|
||||
editorActor,
|
||||
fillCreation,
|
||||
geometryField,
|
||||
historyButton,
|
||||
INKSCAPE_EXPORT,
|
||||
openDraft,
|
||||
openSection,
|
||||
pickAnnotation,
|
||||
place,
|
||||
revisionText,
|
||||
savedLine,
|
||||
saveDraft,
|
||||
saveLine,
|
||||
secondSession,
|
||||
selectionTag,
|
||||
selectTab,
|
||||
serverDocument,
|
||||
showDrawing,
|
||||
toolButton,
|
||||
UNSAVED_LINE,
|
||||
} from '../support/editor'
|
||||
import { signIn } from '../support/shell'
|
||||
|
||||
@@ -236,9 +241,7 @@ async function reloadAndRestore(page: Page, sheetId: string) {
|
||||
).toBeVisible()
|
||||
expect(page.url()).toContain(sheetId)
|
||||
await clickButton(page, dict['editor.draft.recovery.restore'])
|
||||
await expect(
|
||||
page.getByText(dict['editor.draft.status.unsaved'], { exact: false }),
|
||||
).toBeVisible()
|
||||
await expect(saveLine(page)).toHaveText(UNSAVED_LINE)
|
||||
}
|
||||
|
||||
test.describe('editor journey (owner trial steps)', () => {
|
||||
@@ -272,18 +275,8 @@ test.describe('editor journey (owner trial steps)', () => {
|
||||
await createAnnotations(page)
|
||||
await repairGeometry(page)
|
||||
// Undo and redo the numeric repair path's last creation.
|
||||
await page
|
||||
.getByRole('button', {
|
||||
name: dict['editor.annotations.undo'],
|
||||
exact: true,
|
||||
})
|
||||
.click()
|
||||
await page
|
||||
.getByRole('button', {
|
||||
name: dict['editor.annotations.redo'],
|
||||
exact: true,
|
||||
})
|
||||
.click()
|
||||
await historyButton(page, dict, 'undo').click()
|
||||
await historyButton(page, dict, 'redo').click()
|
||||
const modified = await modifyAnnotations(page)
|
||||
await expectAccessible(page, 'the editor with annotations')
|
||||
await saveDraft(page, dict, 1)
|
||||
@@ -342,14 +335,7 @@ test.describe('editor journey (owner trial steps)', () => {
|
||||
await expect(conflict).toContainText('révision 3')
|
||||
await clickDialog(conflict, dict['editor.draft.conflict.reload'])
|
||||
await expect(conflict).toBeHidden()
|
||||
await expect(
|
||||
page.getByText(
|
||||
dict['editor.draft.status.revision'].replace('{revision}', '3'),
|
||||
{
|
||||
exact: true,
|
||||
},
|
||||
),
|
||||
).toBeVisible()
|
||||
await expect(saveLine(page)).toHaveText(revisionText(dict, 3))
|
||||
|
||||
// The conflict again, resolved by keeping this version after the confirmation.
|
||||
await commitText(
|
||||
@@ -369,14 +355,7 @@ test.describe('editor journey (owner trial steps)', () => {
|
||||
await expect(again).toContainText('Remplacer la révision 4')
|
||||
await clickDialog(again, dict['editor.draft.conflict.keep'])
|
||||
await expect(again).toBeHidden()
|
||||
await expect(
|
||||
page.getByText(
|
||||
dict['editor.draft.status.revision'].replace('{revision}', '5'),
|
||||
{
|
||||
exact: true,
|
||||
},
|
||||
),
|
||||
).toBeVisible()
|
||||
await expect(saveLine(page)).toHaveText(savedLine(dict, 5))
|
||||
await second.context.close()
|
||||
|
||||
await selectTab(page, dict, 'verification')
|
||||
|
||||
Reference in new issue
Block a user