mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-20 07:49:43 +02:00
#530 Add unit test for hex nodes
This commit is contained in:
@@ -1402,6 +1402,27 @@ describe('when parsing ', function() {
|
|||||||
expect(vert['a'].type).toBe('diamond');
|
expect(vert['a'].type).toBe('diamond');
|
||||||
expect(vert['a'].text).toBe('A <br/> end');
|
expect(vert['a'].text).toBe('A <br/> end');
|
||||||
});
|
});
|
||||||
|
it('should handle a single hexagon node', function() {
|
||||||
|
// Silly but syntactically correct
|
||||||
|
const res = flow.parser.parse('graph TD;a{{A}};');
|
||||||
|
|
||||||
|
const vert = flow.parser.yy.getVertices();
|
||||||
|
const edges = flow.parser.yy.getEdges();
|
||||||
|
|
||||||
|
expect(edges.length).toBe(0);
|
||||||
|
expect(vert['a'].type).toBe('hexagon');
|
||||||
|
});
|
||||||
|
it('should handle a single hexagon node with html in it', function() {
|
||||||
|
// Silly but syntactically correct
|
||||||
|
const res = flow.parser.parse('graph TD;a{{A <br> end}};');
|
||||||
|
|
||||||
|
const vert = flow.parser.yy.getVertices();
|
||||||
|
const edges = flow.parser.yy.getEdges();
|
||||||
|
|
||||||
|
expect(edges.length).toBe(0);
|
||||||
|
expect(vert['a'].type).toBe('hexagon');
|
||||||
|
expect(vert['a'].text).toBe('A <br/> end');
|
||||||
|
});
|
||||||
it('should handle a single round node with html in it', function() {
|
it('should handle a single round node with html in it', function() {
|
||||||
// Silly but syntactically correct
|
// Silly but syntactically correct
|
||||||
const res = flow.parser.parse('graph TD;a(A <br> end);');
|
const res = flow.parser.parse('graph TD;a(A <br> end);');
|
||||||
|
Reference in New Issue
Block a user