From b6d940724623e5224f617319fef87135e491db27 Mon Sep 17 00:00:00 2001 From: ashishjain0512 Date: Tue, 23 Jul 2019 06:51:18 -0700 Subject: [PATCH] Added Jest test case for handling underscore in vertex name --- src/diagrams/flowchart/parser/flow.spec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/diagrams/flowchart/parser/flow.spec.js b/src/diagrams/flowchart/parser/flow.spec.js index 070b4781d..936d3d621 100644 --- a/src/diagrams/flowchart/parser/flow.spec.js +++ b/src/diagrams/flowchart/parser/flow.spec.js @@ -1508,6 +1508,17 @@ describe('when parsing ', function () { expect(edges.length).toBe(0) expect(vert['i-d'].styles.length).toBe(0) }) + fit('should handle a single node with alphanumerics containing a underscore sign', function () { + // Silly but syntactically correct + const res = flow.parser.parse('graph TD;i_d;') + + const vert = flow.parser.yy.getVertices() + const edges = flow.parser.yy.getEdges() + + expect(edges.length).toBe(0) + expect(vert['i_d'].styles.length).toBe(0) + }) + // log.debug(flow.parser.parse('graph TD;style Q background:#fff;')); it('should handle styles for vertices', function () { const res = flow.parser.parse('graph TD;style Q background:#fff;')