Add unit test for vertex and edge having both strings and text

This commit is contained in:
Ibrahim Wassouf 2023-07-22 15:09:24 -03:00
parent 3ab0e9998d
commit fd88b424b4

View File

@ -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');
});
});