Add support for node(-ellipse shape-) in flow charts

This commit is contained in:
Tomasz Szczęśniak-Szlagowski
2015-10-24 23:34:21 +01:00
parent 1a60b6e412
commit e4d25ed9cd
5 changed files with 30 additions and 4 deletions

View File

@@ -922,6 +922,7 @@ describe('when parsing ',function(){
expect(vert['A'].type).toBe('square');
expect(vert['A'].text).toBe('chimpansen hoppar ()[]');
});
it('should handle text in circle vertices with space',function(){
var res = flow.parser.parse('graph TD;A((chimpansen hoppar))-->C;');
@@ -932,6 +933,16 @@ describe('when parsing ',function(){
expect(vert['A'].text).toBe('chimpansen hoppar');
});
it('should handle text in ellipse vertices', function(){
var res = flow.parser.parse('graph TD\nA(-this is an ellipse-)-->B');
var vert = flow.parser.yy.getVertices();
var edges = flow.parser.yy.getEdges();
expect(vert['A'].type).toBe('ellipse');
expect(vert['A'].text).toBe('this is an ellipse');
});
it('should handle text in diamond vertices with space',function(){
var res = flow.parser.parse('graph TD;A(chimpansen hoppar)-->C;');