mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 06:49:47 +02:00
add title getters and setters, add spec for stateDiagram-v2
This commit is contained in:
@@ -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 +-!
|
||||
|
Reference in New Issue
Block a user