Markdown OKF-Schema Studio

Use case StRS-MDOKFSTUDIO-BLOCK-006

Typed text is saved, survives updates and is never lost on leaving

As a writer, I never lose the text I typed in the preview, saved to my Markdown file as I type; I keep it or drop it with one clear action; and I leave the block, the file or the window with my last words saved first.

Use case diagram

How it is split

This use case (StRS) is reached by 2 paths, one per coloured line. A path goes from one situation (circle) to the next; each step (pill) is a behaviour (SwRS) with its own tests. Where paths meet, they share the circle or the step.

path 1: Type, then finish path 2: Leave while typing, starts at 2 other outcomeone dot = one scenario checked: nominal boundary refusal
SwRS-MDOKFSTUDIO-BLOCK-042: Typing is autosaved as the smallest single replacementSwRS-MDOKFSTUDIO-BLOCK-0426 tests400 milliseconds after the lastkeystroke the text is autosaved asthe smallest single replacementSwRS-MDOKFSTUDIO-BLOCK-047: Done, Cmd/Ctrl+Enter or leaving the text box commits the editSwRS-MDOKFSTUDIO-BLOCK-04710 testsDone, Cmd or Ctrl+Enter, orleaving the text box commits theeditSwRS-MDOKFSTUDIO-BLOCK-058: Every host source edit is one undo step, renders once and reports a failed applySwRS-MDOKFSTUDIO-BLOCK-0588 teststhe preview renders once after thefinal saveSwRS-MDOKFSTUDIO-BLOCK-205: Open editors are saved before the page hides or leaves the documentSwRS-MDOKFSTUDIO-BLOCK-2057 testsa followed link, Back or anotherdocument saves the typed textfirstSwRS-MDOKFSTUDIO-BLOCK-042: Typing is autosaved as the smallest single replacementSwRS-MDOKFSTUDIO-BLOCK-0426 testsan autosave of unchangedtext sends nothingSwRS-MDOKFSTUDIO-BLOCK-193: Page updates wait while an inline editor is openSwRS-MDOKFSTUDIO-BLOCK-1936 testsa render that arrives whilethe editor is open waitsSwRS-MDOKFSTUDIO-BLOCK-216: A refused open or save keeps the typed text and says whySwRS-MDOKFSTUDIO-BLOCK-21610 testsa refused save keeps thetyped text and says whySwRS-MDOKFSTUDIO-BLOCK-047: Done, Cmd/Ctrl+Enter or leaving the text box commits the editSwRS-MDOKFSTUDIO-BLOCK-04710 teststhe host refuses the final saveSwRS-MDOKFSTUDIO-BLOCK-053: Cancel and Escape restore the saved text, or close the editor during a final saveSwRS-MDOKFSTUDIO-BLOCK-05310 testsCancel or Escape restores the saved text, or closes theeditor during a final saveSwRS-MDOKFSTUDIO-BLOCK-270: Every final save of a block or cell editor endsSwRS-MDOKFSTUDIO-BLOCK-2703 testsevery final save ends in a closed editor or an error thatgives the text backA block editor is open (paths 1, 2)A block editor is open2The typed text is in the documentThe typed text is in thedocumentThe final text is savedThe final text is savedThe preview shows the saved block onceThe preview shows thesaved block onceThe typed text is saved before the page leaves the documentThe typed text is savedbefore the page leavesthe document

This map has 378 different ways through it in 8 steps or fewer. Instead of testing each one end to end, the 8 behaviours on the map are tested one by one, with 58 scenarios.

Behaviours of this use case

SwRS-MDOKFSTUDIO-BLOCK-042Typing is autosaved as the smallest single replacement 6 testsSwRS-MDOKFSTUDIO-BLOCK-047Done, Cmd/Ctrl+Enter or leaving the text box commits the edit 10 testsSwRS-MDOKFSTUDIO-BLOCK-053Cancel and Escape restore the saved text, or close the editor during a final save 10 testsSwRS-MDOKFSTUDIO-BLOCK-191The host holds an open block edit and ends it when the block changes not on the map6 testsSwRS-MDOKFSTUDIO-BLOCK-193Page updates wait while an inline editor is open 6 testsSwRS-MDOKFSTUDIO-BLOCK-205Open editors are saved before the page hides or leaves the document 7 testsSwRS-MDOKFSTUDIO-BLOCK-216A refused open or save keeps the typed text and says why 10 testsSwRS-MDOKFSTUDIO-BLOCK-228Opening, saving and closing an editor keep the reading position not on the map6 testsSwRS-MDOKFSTUDIO-BLOCK-256The host refuses a block edit whose first line is blank not on the map2 testsSwRS-MDOKFSTUDIO-BLOCK-263A block editor left without a change, or whose final save writes nothing, always closes not on the map5 testsSwRS-MDOKFSTUDIO-BLOCK-270Every final save of a block or cell editor ends 3 testsSwRS-MDOKFSTUDIO-TRUST-005The host handles the page messages of every preview, whatever the trust not on the map17 testsSwRS-MDOKFSTUDIO-TRUST-059The page accepts only registered host messages addressed to its render not on the map6 testsSwRS-MDOKFSTUDIO-TRUST-065A page message is matched to the shown render or document by the gate of its type not on the map12 tests
SwRS-MDOKFSTUDIO-BLOCK-244previewEditClosed carries the id of the closed editor superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-245previewEditFlushed carries the flush id and a flag superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-TRUST-064Flush and editor watch messages are addressed by their own id superseded superseded by SwRS-MDOKFSTUDIO-TRUST-059 Markdown file