From 48ce7a9b787591d0918990aa4f7dad6acbdb7782 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Thu, 7 Nov 2019 19:19:44 +0100 Subject: [PATCH] #1023 Fix for tests --- src/diagrams/flowchart/flowDb.js | 2 +- src/diagrams/flowchart/parser/flow-singlenode.spec.js | 6 +++--- src/diagrams/flowchart/parser/subgraph.spec.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/diagrams/flowchart/flowDb.js b/src/diagrams/flowchart/flowDb.js index 214e12edc..abe922bbc 100644 --- a/src/diagrams/flowchart/flowDb.js +++ b/src/diagrams/flowchart/flowDb.js @@ -4,7 +4,7 @@ import { logger } from '../../logger'; import utils from '../../utils'; import { getConfig } from '../../config'; -const MERMAID_DOM_ID_PREFIX = 'mermaid-dom-id'; +const MERMAID_DOM_ID_PREFIX = 'mermaid-dom-id-'; const config = getConfig(); let vertices = {}; diff --git a/src/diagrams/flowchart/parser/flow-singlenode.spec.js b/src/diagrams/flowchart/parser/flow-singlenode.spec.js index 9773a04b4..1d9f4dbad 100644 --- a/src/diagrams/flowchart/parser/flow-singlenode.spec.js +++ b/src/diagrams/flowchart/parser/flow-singlenode.spec.js @@ -168,7 +168,7 @@ describe('[Singlenodes] when parsing', () => { const edges = flow.parser.yy.getEdges(); expect(edges.length).toBe(0); - expect(vert['s1'].text).toBe('1'); + expect(vert['mermaid-dom-id-1'].text).toBe('1'); }); it('should handle a single node with a single digit in a subgraph', function() { @@ -180,7 +180,7 @@ describe('[Singlenodes] when parsing', () => { const edges = flow.parser.yy.getEdges(); expect(edges.length).toBe(0); - expect(vert['s1'].text).toBe('1'); + expect(vert['mermaid-dom-id-1'].text).toBe('1'); }); it('should handle a single node with alphanumerics starting on a num', function() { @@ -191,7 +191,7 @@ describe('[Singlenodes] when parsing', () => { const edges = flow.parser.yy.getEdges(); expect(edges.length).toBe(0); - expect(vert['s1id'].styles.length).toBe(0); + expect(vert['mermaid-dom-id-1id'].styles.length).toBe(0); }); it('should handle a single node with alphanumerics containing a minus sign', function() { diff --git a/src/diagrams/flowchart/parser/subgraph.spec.js b/src/diagrams/flowchart/parser/subgraph.spec.js index 0bf3e63d6..de76a16b4 100644 --- a/src/diagrams/flowchart/parser/subgraph.spec.js +++ b/src/diagrams/flowchart/parser/subgraph.spec.js @@ -83,7 +83,7 @@ describe('when parsing subgraphs', function() { const subgraph = subgraphs[0]; expect(subgraph.nodes.length).toBe(1); expect(subgraph.nodes[0]).toBe('A'); - expect(subgraph.id).toBe('s1test'); + expect(subgraph.id).toBe('mermaid-dom-id-1test'); }); it('should handle subgraphs1', function() {