Use case StRS-MDOKFSTUDIO-DIAG-001
A writer reads and inserts Mermaid diagrams that follow the theme
As a writer, I put a Mermaid diagram in my document, or insert one in a single step, and see the drawn diagram in the preview in the colours of my theme, with the source one click away.
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: Insert a diagram and read it path 2: Break a diagram other outcomeone dot = one scenario checked: nominal boundary refusal
Path 1: Insert a diagram and read it
- Edit mode is on with the GFM paletteSwRS-MDOKFSTUDIO-DIAG-017 the Strict or MyST palette offers no MermaidSwRS-MDOKFSTUDIO-DIAG-017 · 5 tests the writer picks Mermaid and a starter flowchart fence is inserted with Start selected
- A Mermaid fence is in the documentSwRS-MDOKFSTUDIO-DIAG-001 an empty fence is left blank, with no messageSwRS-MDOKFSTUDIO-DIAG-001 · 10 tests the preview renders the fence as one picture with its source in a collapsed "Diagram source" disclosure
- The diagram is drawn as a pictureSwRS-MDOKFSTUDIO-DIAG-005 the colours stay the same, nothing is redrawnSwRS-MDOKFSTUDIO-DIAG-009 a content update that replaces the node keeps the earlier pictureSwRS-MDOKFSTUDIO-DIAG-005 · 3 tests the reader changes the theme
- The diagram is redrawn in the new theme, labels kept
Path 2: Break a diagram
- A Mermaid fence holds invalid syntaxSwRS-MDOKFSTUDIO-DIAG-015 a reason that holds markup is shown as textSwRS-MDOKFSTUDIO-DIAG-015 · 2 tests the page cannot draw it and shows one message with a collapsed "Show the parser error" section
- A parser message shows and the source stays available
This map has 325 different ways through it in 8 steps or fewer. Instead of testing each one end to end, the 5 behaviours on the map are tested one by one, with 27 scenarios.
Behaviours of this use case
SwRS-MDOKFSTUDIO-DIAG-001Mermaid fences become inert diagram pictures 10 testsSwRS-MDOKFSTUDIO-DIAG-005Mermaid colours follow the preview theme 3 testsSwRS-MDOKFSTUDIO-DIAG-009Diagrams are drawn once per source and theme and late results are dropped 5 testsSwRS-MDOKFSTUDIO-DIAG-015Invalid Mermaid shows one message with the parser reason 2 testsSwRS-MDOKFSTUDIO-DIAG-017The Mermaid action inserts a starter flowchart in GFM mode 5 testsSwRS-MDOKFSTUDIO-DIAG-129A diagram renderer script loads only when the page holds a figure of its engine not on the map1 test
SwRS-MDOKFSTUDIO-DIAG-002The Mermaid renderer loads only when a Mermaid figure exists superseded superseded by SwRS-MDOKFSTUDIO-DIAG-001 Markdown file
SwRS-MDOKFSTUDIO-DIAG-003Mermaid diagrams are drawn as inert pictures superseded superseded by SwRS-MDOKFSTUDIO-DIAG-001 Markdown file
SwRS-MDOKFSTUDIO-DIAG-004Mermaid pictures keep their natural size within the content width superseded superseded by SwRS-MDOKFSTUDIO-DIAG-001 Markdown file
SwRS-MDOKFSTUDIO-DIAG-006Mermaid diagrams are drawn again when the theme changes superseded superseded by SwRS-MDOKFSTUDIO-DIAG-005 Markdown file
SwRS-MDOKFSTUDIO-DIAG-007Mermaid falls back to built-in colours superseded superseded by SwRS-MDOKFSTUDIO-DIAG-005 Markdown file
SwRS-MDOKFSTUDIO-DIAG-008Mermaid edge labels stay readable superseded superseded by SwRS-MDOKFSTUDIO-DIAG-005 Markdown file
SwRS-MDOKFSTUDIO-DIAG-010The Mermaid drawing cache keeps 64 drawings deprecated deprecated Markdown file
SwRS-MDOKFSTUDIO-DIAG-011A content patch draws only Mermaid diagrams not yet drawn superseded superseded by SwRS-MDOKFSTUDIO-DIAG-009 Markdown file
SwRS-MDOKFSTUDIO-DIAG-012Mermaid draw passes run one at a time superseded superseded by SwRS-MDOKFSTUDIO-DIAG-009 Markdown file
SwRS-MDOKFSTUDIO-DIAG-013Mermaid element ids stay unique for the page life deprecated deprecated Markdown file
SwRS-MDOKFSTUDIO-DIAG-014A late Mermaid result for a replaced theme is not shown superseded superseded by SwRS-MDOKFSTUDIO-DIAG-009 Markdown file
SwRS-MDOKFSTUDIO-DIAG-016An invalid Mermaid diagram keeps exactly one error superseded superseded by SwRS-MDOKFSTUDIO-DIAG-015 Markdown file
SwRS-MDOKFSTUDIO-DIAG-018Mermaid is offered in the GFM palette mode only superseded superseded by SwRS-MDOKFSTUDIO-DIAG-017 Markdown file
SwRS-MDOKFSTUDIO-DIAG-019Comment quotes are never wrapped inside diagrams superseded superseded by SwRS-MDOKFSTUDIO-REVIEW-017 Markdown file
SwRS-MDOKFSTUDIO-DIAG-020Selecting text inside a diagram offers no comment superseded superseded by SwRS-MDOKFSTUDIO-REVIEW-038 Markdown file
SwRS-MDOKFSTUDIO-DIAG-021Diagrams can use the wider column in Auto width deprecated deprecated Markdown file
SwRS-MDOKFSTUDIO-DIAG-022A diagram under edit is hidden superseded superseded by SwRS-MDOKFSTUDIO-DIAG-001 Markdown file
SwRS-MDOKFSTUDIO-DIAG-116A late Mermaid error for a replaced key is not shown superseded superseded by SwRS-MDOKFSTUDIO-DIAG-009 Markdown file