mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-16 13:59:54 +02:00
Add unit test for vertex and edge having both strings and text
This commit is contained in:
@@ -690,4 +690,16 @@ describe('[Text] when parsing', () => {
|
||||
expect(vert['A'].text).toBe(',.?!+-*');
|
||||
expect(edges[0].text).toBe(',.?!+-*');
|
||||
});
|
||||
|
||||
it('should handle strings and text at the same time', function () {
|
||||
const res = flow.parser.parse(
|
||||
'graph TD;A(this node has "string" and text)-->|this link has "string" and text|C;'
|
||||
);
|
||||
|
||||
const vert = flow.parser.yy.getVertices();
|
||||
const edges = flow.parser.yy.getEdges();
|
||||
|
||||
expect(vert['A'].text).toBe('this node has "string" and text');
|
||||
expect(edges[0].text).toBe('this link has "string" and text');
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user