From e8af77896227c52245439fbeaf76b65e31e30290 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Sat, 18 Jul 2020 13:52:51 +0200 Subject: [PATCH] #1542 Updated test --- cypress/integration/rendering/theme.spec.js | 9 ++++++++- cypress/platform/current.html | 10 +++++----- src/diagrams/state/styles.js | 5 +++++ src/mermaidAPI.js | 9 +++++---- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/cypress/integration/rendering/theme.spec.js b/cypress/integration/rendering/theme.spec.js index e11f663d5..3a0fd705a 100644 --- a/cypress/integration/rendering/theme.spec.js +++ b/cypress/integration/rendering/theme.spec.js @@ -11,6 +11,7 @@ describe('Pie Chart', () => { it('should render a pie diagram', () => { imgSnapshotTest( ` + %%{init: { 'logLevel': 0, 'theme': '${theme}'} }%% pie title Sports in Sweden "Bandy" : 40 "Ice-Hockey" : 80 @@ -23,6 +24,7 @@ describe('Pie Chart', () => { it('should render a flowchart diagram', () => { imgSnapshotTest( ` + %%{init: { 'logLevel': 0, 'theme': '${theme}'} }%% graph TD A[Christmas] -->|Get money| B(Go shopping) B --> C{Let me think} @@ -45,6 +47,7 @@ describe('Pie Chart', () => { it('should render a new flowchart diagram', () => { imgSnapshotTest( ` + %%{init: { 'logLevel': 0, 'theme': '${theme}'} }%% flowchart TD A[Christmas] -->|Get money| B(Go shopping) B --> C{Let me think} @@ -67,6 +70,7 @@ describe('Pie Chart', () => { it('should render a sequence diagram', () => { imgSnapshotTest( ` + %%{init: { 'logLevel': 0, 'theme': '${theme}'} }%% sequenceDiagram autonumber par Action 1 @@ -93,6 +97,7 @@ describe('Pie Chart', () => { it('should render a class diagram', () => { imgSnapshotTest( ` + %%{init: { 'logLevel': 0, 'theme': '${theme}'} }%% classDiagram Animal "*" <|-- "1" Duck Animal "1" <|-- "10" Fish @@ -138,6 +143,7 @@ describe('Pie Chart', () => { it('should render a state diagram', () => { imgSnapshotTest( ` + %%{init: { 'logLevel': 0, 'theme': '${theme}'} }%% stateDiagram [*] --> Active @@ -169,6 +175,7 @@ stateDiagram it('should render a state diagram (v2)', () => { imgSnapshotTest( ` + %%{init: { 'logLevel': 0, 'theme': '${theme}'} }%% stateDiagram-v2 [*] --> Active @@ -200,7 +207,7 @@ stateDiagram-v2 it('should render a er diagram', () => { imgSnapshotTest( ` - erDiagram +erDiagram CUSTOMER }|..|{ DELIVERY-ADDRESS : has CUSTOMER ||--o{ ORDER : places CUSTOMER ||--o{ INVOICE : "liable for" diff --git a/cypress/platform/current.html b/cypress/platform/current.html index d0701e355..2d6425a80 100644 --- a/cypress/platform/current.html +++ b/cypress/platform/current.html @@ -42,7 +42,7 @@ graph TD G end -
+
%%{init: { 'logLevel': 1, 'theme': 'forest'} }%% graph TD A[Christmas] -->|Get money| B(Go shopping) @@ -59,7 +59,7 @@ graph TD G end
-
+
%%{init: { 'logLevel': 1, 'theme': 'neutral'} }%% graph TD @@ -77,7 +77,7 @@ graph TD G end
-
+
%%{init: { 'logLevel': 1, 'theme': 'dark'} }%% graph TD @@ -95,7 +95,7 @@ graph TD G end
-
+
%%{init: { 'logLevel': 1} }%% graph TD @@ -121,7 +121,7 @@ graph TD // console.error('Mermaid error: ', err); }; mermaid.initialize({ - // theme: 'dark', + theme: 'forest', // theme: 'dark', // arrowMarkerAbsolute: true, // themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}', diff --git a/src/diagrams/state/styles.js b/src/diagrams/state/styles.js index 1d07e4a1f..0cbab6eff 100644 --- a/src/diagrams/state/styles.js +++ b/src/diagrams/state/styles.js @@ -138,6 +138,11 @@ g.stateGroup line { ry: 0; } +#dependencyStart, #dependencyEnd { + fill: ${options.nodeBorder}; + stroke: ${options.nodeBorder}; + stroke-width: 1; +} `; export default getStyles; diff --git a/src/mermaidAPI.js b/src/mermaidAPI.js index 2e74f89e5..a73099df7 100644 --- a/src/mermaidAPI.js +++ b/src/mermaidAPI.js @@ -519,7 +519,7 @@ function updateRendererConfigs(conf) { } function reinitialize(options) { - console.log(`mermaidAPI.reinitialize: v${pkg.version}`, options); + console.warn(`mermaidAPI.reinitialize: v${pkg.version}`, options); if (options.theme && themes[options.theme]) { // Todo merge with user options options.themeVariables = themes[options.theme]; @@ -533,15 +533,16 @@ function reinitialize(options) { } function initialize(options) { - // console.log(`mermaidAPI.initialize: v${pkg.version}`); + console.log(`mermaidAPI.initialize: v${pkg.version} ${options}`); // Set default options if (options && options.theme && themes[options.theme]) { // Todo merge with user options options.themeVariables = themes[options.theme]; - } else { - if (options) options.themeVariables = themes.default; } + // else { + // if (options) options.themeVariables = themes.default; + // } const config = typeof options === 'object' ? setSiteConfig(options) : getSiteConfig();