Updated user state diagram parsing with the new syntax

This commit is contained in:
Knut Sveidqvist
2022-04-30 15:50:02 +02:00
parent ae91f794d6
commit 3baf31695e
3 changed files with 40 additions and 29 deletions

View File

@@ -27,9 +27,9 @@ describe('state diagram, ', function () {
const description = stateDb.getAccDescription();
expect(description).toBe('');
});
it('simple with accDescription', function () {
it('simple with accDescription (accDescr)', function () {
const str = `stateDiagram\n
accDescription a simple description of the diagram
accDescr: a simple description of the diagram
State1 : this is another string
[*] --> State1
State1 --> [*]
@@ -39,9 +39,24 @@ describe('state diagram, ', function () {
const description = stateDb.getAccDescription();
expect(description).toBe('a simple description of the diagram');
});
it('simple with title', function () {
it('simple with multiline accDescription (accDescr)', function () {
const str = `stateDiagram\n
title a simple title of the diagram
accDescr {
a simple description of the diagram
using multiple lines
}
State1 : this is another string
[*] --> State1
State1 --> [*]
`;
parser.parse(str);
const description = stateDb.getAccDescription();
expect(description).toBe('a simple description of the diagram\nusing multiple lines');
});
it('simple with title (accDescr)', function () {
const str = `stateDiagram\n
accTitle: a simple title of the diagram
State1 : this is another string
[*] --> State1
State1 --> [*]