mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 06:49:47 +02:00
#945 Rendering from diagram data
This commit is contained in:
@@ -8,6 +8,36 @@ describe('state diagram, ', function() {
|
||||
parser.yy = stateDb;
|
||||
});
|
||||
|
||||
fit('super simple', function() {
|
||||
const str = `
|
||||
stateDiagram
|
||||
[*] --> State1
|
||||
State1 --> [*]
|
||||
`;
|
||||
|
||||
parser.parse(str);
|
||||
expect(stateDb.getRelations()).toEqual([
|
||||
{ id1: 'start1', id2: 'State1' },
|
||||
{ id1: 'State1', id2: 'end1' }
|
||||
]);
|
||||
expect(stateDb.getStates()).toEqual({
|
||||
State1: {
|
||||
id: 'State1',
|
||||
type: 'default',
|
||||
descriptions: []
|
||||
},
|
||||
end1: {
|
||||
id: 'end1',
|
||||
type: 'end',
|
||||
descriptions: []
|
||||
},
|
||||
start1: {
|
||||
id: 'start1',
|
||||
type: 'start',
|
||||
descriptions: []
|
||||
}
|
||||
});
|
||||
});
|
||||
it('simple', function() {
|
||||
const str = `stateDiagram\n
|
||||
State1 : this is another string
|
||||
|
Reference in New Issue
Block a user