mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Add unit test for vertex and edge having both strings and text
This commit is contained in:
parent
3ab0e9998d
commit
fd88b424b4
@ -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');
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user