From 54e6e2f66efd9ee298d286416b507cef3636135f Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Wed, 9 Oct 2019 20:05:24 +0200 Subject: [PATCH] #945 Some bug fixes and draft docs --- .../rendering/stateDiagram.spec.js | 13 +- docs/_sidebar.md | 1 + docs/index.html | 4 +- docs/stateDiagram.md | 267 ++++++++++++++++++ src/diagrams/state/parser/stateDiagram.jison | 6 +- src/diagrams/state/shapes.js | 10 +- src/diagrams/state/stateRenderer.js | 14 +- 7 files changed, 303 insertions(+), 12 deletions(-) create mode 100755 docs/stateDiagram.md diff --git a/cypress/integration/rendering/stateDiagram.spec.js b/cypress/integration/rendering/stateDiagram.spec.js index bf2055008..bb93511a9 100644 --- a/cypress/integration/rendering/stateDiagram.spec.js +++ b/cypress/integration/rendering/stateDiagram.spec.js @@ -13,6 +13,17 @@ describe('State diagram', () => { ); cy.get('svg'); }); + it('should render a single state with short descr', () => { + imgSnapshotTest( + ` + stateDiagram + state "A long long name" as long1 + state "A" as longlonglongid + `, + { logLevel: 0 } + ); + cy.get('svg'); + }); it('should render a state with a note', () => { imgSnapshotTest( ` @@ -145,7 +156,7 @@ describe('State diagram', () => { Off --> On : Turn on } - TV--> Console : KarlMartin + TV--> Console state Console { [*] --> Off2: Off to start with diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 7c8e954fe..2200193db 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -9,6 +9,7 @@ - Diagrams - [Flowchart](flowchart.md) + - [State diagram](stateDiagram.md) - [Sequence diagram](sequenceDiagram.md) - [Gantt](gantt.md) - [Pie Chart](pie.md) diff --git a/docs/index.html b/docs/index.html index 45e9ef4a8..169247da2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -7,8 +7,8 @@ - - + +