Markdown OKF-Schema Studio

Use case StRS-MDOKFSTUDIO-BLOCK-025

Preview edits land exactly, in one undo step, keep line endings, or are refused with a reason

As a writer, I trust that every change I make from the preview lands on the lines I meant, reverts with one undo and keeps the line endings of my document, or is refused with a reason, never landing on the wrong text; I am told why when an edit, move or paste cannot be done, and my document and clipboard are left untouched.

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.

path 1: Edit a block and undo it path 2: Cut blocks and paste them other outcomeone dot = one scenario checked: nominal boundary refusal
SwRS-MDOKFSTUDIO-BLOCK-042: Typing is autosaved as the smallest single replacementSwRS-MDOKFSTUDIO-BLOCK-0426 teststhe typed text is autosaved as thesmallest single replacementSwRS-MDOKFSTUDIO-BLOCK-058: Every host source edit is one undo step, renders once and reports a failed applySwRS-MDOKFSTUDIO-BLOCK-0588 teststhe edit is one undo step and thepreview renders onceSwRS-MDOKFSTUDIO-BLOCK-169: Cut removes the selected blocks with one blank separatorSwRS-MDOKFSTUDIO-BLOCK-1695 testsa cut puts their Markdown on theclipboard and deletes them withone blank separatorSwRS-MDOKFSTUDIO-BLOCK-174: Paste inserts the clipboard as new blocks after the selection or insert pointSwRS-MDOKFSTUDIO-BLOCK-1745 testspaste inserts the clipboard textas new blocks after the insertpointSwRS-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-058: Every host source edit is one undo step, renders once and reports a failed applySwRS-MDOKFSTUDIO-BLOCK-0588 testsan edit that VS Code does not apply or rejects is answeredwith a reasonSwRS-MDOKFSTUDIO-BLOCK-234: Preview edits keep the line endings of the documentSwRS-MDOKFSTUDIO-BLOCK-23411 teststhe line endings of the document are keptSwRS-MDOKFSTUDIO-BLOCK-124: Moves and clipboard edits are refused for ranges that do not match the documentSwRS-MDOKFSTUDIO-BLOCK-1245 testsranges that do not match thedocument are refused with areasonSwRS-MDOKFSTUDIO-BLOCK-127: An included block is never moved, cut, copied, selected or pasted afterSwRS-MDOKFSTUDIO-BLOCK-1279 testscopy and cut of an includedblock are refusedSwRS-MDOKFSTUDIO-BLOCK-174: Paste inserts the clipboard as new blocks after the selection or insert pointSwRS-MDOKFSTUDIO-BLOCK-1745 teststhe document changed while the clipboard was readA block editor is openA block editor is openThe typed text is in the documentThe typed text is in thedocumentThe edit is one undo step with the line endings keptThe edit is one undostep with the lineendings keptA run of blocks is selectedA run of blocks isselectedThe blocks are on the clipboard and gone from the documentThe blocks are on theclipboard and gone fromthe documentThe blocks are in their new placeThe blocks are in theirnew place

This map has 86 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 57 scenarios.

Behaviours of this use case

SwRS-MDOKFSTUDIO-BLOCK-042Typing is autosaved as the smallest single replacement 6 testsSwRS-MDOKFSTUDIO-BLOCK-058Every host source edit is one undo step, renders once and reports a failed apply 8 testsSwRS-MDOKFSTUDIO-BLOCK-094The host inserts a new block with clean blank lines not on the map2 testsSwRS-MDOKFSTUDIO-BLOCK-117The host swaps two blocks in one edit and keeps their separators not on the map3 testsSwRS-MDOKFSTUDIO-BLOCK-124Moves and clipboard edits are refused for ranges that do not match the document 5 testsSwRS-MDOKFSTUDIO-BLOCK-127An included block is never moved, cut, copied, selected or pasted after 9 testsSwRS-MDOKFSTUDIO-BLOCK-169Cut removes the selected blocks with one blank separator 5 testsSwRS-MDOKFSTUDIO-BLOCK-174Paste inserts the clipboard as new blocks after the selection or insert point 5 testsSwRS-MDOKFSTUDIO-BLOCK-216A refused open or save keeps the typed text and says why 10 testsSwRS-MDOKFSTUDIO-BLOCK-234Preview edits keep the line endings of the document 11 testsSwRS-MDOKFSTUDIO-BLOCK-259The host ignores a malformed block-editing message and changes nothing not on the map2 testsSwRS-MDOKFSTUDIO-BLOCK-264An emptied top-level block or list item is deleted with its separator when the writer commits it not on the map4 testsSwRS-MDOKFSTUDIO-BLOCK-265Delete block deletes the blocks of a selection with one separator in one undo step not on the map7 testsSwRS-MDOKFSTUDIO-BLOCK-266Edit mode shows each shown blank line as a blank-line block not on the map12 testsSwRS-MDOKFSTUDIO-BLOCK-267A blank-line block takes the arrows, Enter and a click not on the map3 testsSwRS-MDOKFSTUDIO-BLOCK-268Typing or pasting in a blank-line block writes the text in place of that blank line not on the map17 testsSwRS-MDOKFSTUDIO-BLOCK-269Removing a blank-line block removes that one blank line not on the map12 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-129The page applies a move result only for its own render superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-109 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-227A thread reply or delete is refused while a block edit is open deprecated deprecated Markdown file
SwRS-MDOKFSTUDIO-BLOCK-232Text edits apply in offset order deprecated deprecated Markdown file
SwRS-MDOKFSTUDIO-BLOCK-233Overlapping or out-of-range text edits are refused deprecated deprecated Markdown file
SwRS-MDOKFSTUDIO-BLOCK-235A refusal is told apart from a plan deprecated deprecated Markdown file
SwRS-MDOKFSTUDIO-BLOCK-236previewEditModeChanged carries a boolean edit mode superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-237previewEditOpen needs an edit id and a line range superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-238previewEditSave needs both texts and valid optional fields superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-239previewEditCancel needs an edit id and a line range superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-240previewBlockMove needs both ranges and a direction superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-241previewBlocksCopy needs a line range superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-242previewBlocksCut needs a line range and an optional pin superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
SwRS-MDOKFSTUDIO-BLOCK-243previewBlocksPaste needs a line to paste after superseded superseded by SwRS-MDOKFSTUDIO-BLOCK-259 Markdown file
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-BLOCK-252Overlapping or out-of-range planned edits leave the document unchanged deprecated deprecated 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