add title getters and setters, add spec for stateDiagram-v2

This commit is contained in:
Tali Herzka
2022-04-08 18:44:22 +00:00
committed by GitHub
parent 9eb18e78c3
commit 897c4259ed
3 changed files with 404 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ describe('state diagram, ', function () {
const description = stateDb.getAccDescription();
expect(description).toBe('');
});
it.only('simple with accDescription', function () {
it('simple with accDescription', function () {
const str = `stateDiagram\n
accDescription a simple description of the diagram
State1 : this is another string
@@ -39,6 +39,18 @@ describe('state diagram, ', function () {
const description = stateDb.getAccDescription();
expect(description).toBe('a simple description of the diagram');
});
it('simple with title', function () {
const str = `stateDiagram\n
title a simple title of the diagram
State1 : this is another string
[*] --> State1
State1 --> [*]
`;
parser.parse(str);
const title = stateDb.getTitle();
expect(title).toBe('a simple title of the diagram');
});
it('simple with directive', function () {
const str = `%%{init: {'logLevel': 0 }}%%
stateDiagram\n
@@ -133,7 +145,7 @@ describe('state diagram, ', function () {
parser.parse(str);
});
it('shall handle descriptions inkluding minus signs', function () {
it('shall handle descriptions including minus signs', function () {
const str = `stateDiagram\n
scale 350 width
[*] --> State1 : This is the description +-!