mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-11 18:19:42 +02:00
feat(flowchart): implement double circle node
The implementation uses two circles, inside each other. A double circle node is opend with `()(` and closed with `)()`.
This commit is contained in:
@@ -159,6 +159,40 @@ describe('[Singlenodes] when parsing', () => {
|
||||
expect(vert['a'].text).toBe('A <br> end');
|
||||
});
|
||||
|
||||
it('should handle a single double circle 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('doublecircle');
|
||||
});
|
||||
|
||||
it('should handle a single double circle node with whitespace after it', 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('doublecircle');
|
||||
});
|
||||
|
||||
it('should handle a single double circle node with html in it (SN3)', 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('doublecircle');
|
||||
expect(vert['a'].text).toBe('A <br> end');
|
||||
});
|
||||
|
||||
it('should handle a single node with alphanumerics starting on a char', function () {
|
||||
// Silly but syntactically correct
|
||||
const res = flow.parser.parse('graph TD;id1;');
|
||||
|
Reference in New Issue
Block a user