mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-20 07:49:43 +02:00
Added Jest test case for handling underscore in vertex name
This commit is contained in:
@@ -1508,6 +1508,17 @@ describe('when parsing ', function () {
|
|||||||
expect(edges.length).toBe(0)
|
expect(edges.length).toBe(0)
|
||||||
expect(vert['i-d'].styles.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;'));
|
// log.debug(flow.parser.parse('graph TD;style Q background:#fff;'));
|
||||||
it('should handle styles for vertices', function () {
|
it('should handle styles for vertices', function () {
|
||||||
const res = flow.parser.parse('graph TD;style Q background:#fff;')
|
const res = flow.parser.parse('graph TD;style Q background:#fff;')
|
||||||
|
Reference in New Issue
Block a user