#945 Rendering from diagram data

This commit is contained in:
Knut Sveidqvist
2019-09-25 21:29:32 +02:00
parent fad76ad534
commit 13baa43081
4 changed files with 64 additions and 49 deletions

View File

@@ -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