Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-BLOCK-053

Cancel and Escape restore the saved text, or close the editor during a final save

When a writer presses Cancel or Escape in a block editor, the page SHALL close the editor, posting previewEditCancel only when an autosave already reached the document, after which the host writes the original text of the block back in one edit; during a final save it closes the editor with no previewEditCancel and the save completes.

Another outcome at step 2 of path 1 in StRS-MDOKFSTUDIO-BLOCK-006, in the state “The typed text is in the document”.

Scenarios 6

The situations the tests check; open one to read it.

nominalNothing autosaved
Givenan editor with typed text that no autosave has posted
Whenthe writer presses Escape
Thenthe editor closes, no save and no cancel is posted and a later blur sends nothing
nominalAfter an autosave
Givenan editor whose text was autosaved
Whenthe writer presses Cancel
Thenthe editor closes and previewEditCancel is posted with the editor id and its lines
nominalThe host restores the original text
InputOutcome
A matching previewEditCancel for a held block edit whose autosave changed the blockThe block text in the document equals the original text and the host edit ends
A matching previewEditCancel for a held insertion whose autosave inserted a new blockThe inserted text is removed again
nominalCancel during a final save closes the editor and the save completes
Givenan editor that posted its final save and has not been answered
an editor that has not finished
Whenthe writer presses Cancel or Escape
the writer presses Cancel
Thenthe editor closes, previewEditClosed is posted with the editor id, no previewEditCancel and no second final save are posted, and the text finished stays in the document
the pending navigation is dropped, and a block or field clicked afterwards opens once the save has ended
the editor cancels as usual
nominalThe host ends a detached save with an answer
InputOutcome
A previewEditClosed with detached for the editor of a held edit whose final save is being writtenThe edit is marked detached, the page editor lock is cleared and the write goes on
The write of that save landspreviewEditSource with done and renderFollows is posted when a render follows, and with done alone when nothing renders
A detached edit with nothing being writtenThe edit completes at once and answers with done
boundaryEscape during an IME composition
InputOutcome
Escape while an input method composition is running in the text boxThe editor stays open and no save or cancel is posted
Escape after the composition endedThe editor cancels

Implemented in 5

Tested by 10