Skip to content

Commit 1d2327c

Browse files
committed
Added test for caps in vertices
1 parent 5f8508a commit 1d2327c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/parser/flow.spec.js

+16
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,15 @@ describe('when parsing ',function(){
7979

8080
expect(edges[0].type).toBe('arrow_cross');
8181
});
82+
it('should handle text on edges with space CAPS',function(){
83+
var res = flow.parser.parse('graph TD;A--x|text including CAPS space|B;');
8284

85+
var vert = flow.parser.yy.getVertices();
86+
var edges = flow.parser.yy.getEdges();
87+
88+
89+
expect(edges[0].type).toBe('arrow_cross');
90+
});
8391
it('should handle multi-line text',function(){
8492
var res = flow.parser.parse('graph TD;A--o|text space|B;\n B-->|more text with space|C;');
8593

@@ -173,7 +181,15 @@ describe('when parsing ',function(){
173181
expect(vert['C'].type).toBe('round');
174182
expect(vert['C'].text).toBe('Chimpansen hoppar åäö <br> - ÅÄÖ');
175183
});
184+
it('should handle text in vertices with CAPS',function(){
185+
var res = flow.parser.parse('graph TD;A-->C(some CAPS);');
176186

187+
var vert = flow.parser.yy.getVertices();
188+
var edges = flow.parser.yy.getEdges();
189+
190+
expect(vert['C'].type).toBe('round');
191+
expect(vert['C'].text).toBe('some CAPS');
192+
});
177193
it('should handle a single node',function(){
178194
// Silly but syntactically correct
179195
var res = flow.parser.parse('graph TD;A;');

0 commit comments

Comments
 (0)