Added the option to disable auto rendering via the mermaid namespace as described in issue #91

Added optional ; as statement separator equal to newline for sequence diagrams (help for tidy users)
This commit is contained in:
knsv
2015-01-06 19:33:00 +01:00
parent 222a6e0682
commit c5c995c916
11 changed files with 227 additions and 115 deletions

View File

@@ -272,6 +272,25 @@ describe('when parsing a sequenceDiagram',function() {
expect(messages[1].from).toBe('Bob');
});
it('it should handle opt statements a sequenceDiagram', function () {
var str = 'sequenceDiagram;Alice->Bob: Hello Bob, how are you?;opt Perhaps a happy response;Bob-->Alice: I am good thanks!;end;';
sq.parse(str);
var actors = sq.yy.getActors();
//console.log(actors);
expect(actors.Alice.description).toBe('Alice');
actors.Bob.description = 'Bob';
var messages = sq.yy.getMessages();
//console.log(messages);
expect(messages.length).toBe(4);
expect(messages[0].from).toBe('Alice');
expect(messages[1].type).toBe(sq.yy.LINETYPE.OPT_START);
expect(messages[2].from).toBe('Bob');
});
it('it should handle alt statements a sequenceDiagram', function () {