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
Path 1: Type, then finish
- A block editor is openSwRS-MDOKFSTUDIO-BLOCK-042 an autosave of unchanged text sends nothingSwRS-MDOKFSTUDIO-BLOCK-193 a render that arrives while the editor is open waitsSwRS-MDOKFSTUDIO-BLOCK-216 a refused save keeps the typed text and says whySwRS-MDOKFSTUDIO-BLOCK-042 · 6 tests 400 milliseconds after the last keystroke the text is autosaved as the smallest single replacement
- The typed text is in the documentSwRS-MDOKFSTUDIO-BLOCK-047 the host refuses the final saveSwRS-MDOKFSTUDIO-BLOCK-053 Cancel or Escape restores the saved text, or closes the editor during a final saveSwRS-MDOKFSTUDIO-BLOCK-270 every final save ends in a closed editor or an error that gives the text backSwRS-MDOKFSTUDIO-BLOCK-047 · 10 tests Done, Cmd or Ctrl+Enter, or leaving the text box commits the edit
- The final text is savedSwRS-MDOKFSTUDIO-BLOCK-058 · 8 tests the preview renders once after the final save
- The preview shows the saved block once
Path 2: Leave while typing
- A block editor is openSwRS-MDOKFSTUDIO-BLOCK-205 · 7 tests a followed link, Back or another document saves the typed text first
- The typed text is saved before the page leaves the 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