mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 23:39:50 +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(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;')
|
||||
|
Reference in New Issue
Block a user