From 8b18fd93f409aa1499d0a228949dd05c7603478d Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 26 Apr 2023 00:20:00 +0530 Subject: [PATCH] Add test --- cypress/integration/rendering/zenuml.spec.js | 19 +++++++++++++++++++ cypress/platform/viewer.js | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 cypress/integration/rendering/zenuml.spec.js diff --git a/cypress/integration/rendering/zenuml.spec.js b/cypress/integration/rendering/zenuml.spec.js new file mode 100644 index 000000000..f317fbe82 --- /dev/null +++ b/cypress/integration/rendering/zenuml.spec.js @@ -0,0 +1,19 @@ +import { imgSnapshotTest } from '../../helpers/util.js'; + +describe('Zen UML', () => { + it('Basic Zen UML diagram', () => { + imgSnapshotTest( + ` + zenuml + A.method() { + if(x) { + B.method() { + selfCall() { return X } + } + } + } + `, + {} + ); + }); +}); diff --git a/cypress/platform/viewer.js b/cypress/platform/viewer.js index a99c150f1..0b566e329 100644 --- a/cypress/platform/viewer.js +++ b/cypress/platform/viewer.js @@ -1,5 +1,6 @@ import mermaid2 from './mermaid.esm.mjs'; import externalExample from '../../packages/mermaid-example-diagram/dist/mermaid-example-diagram.core.mjs'; +import zenUml from '../../packages/mermaid-zenuml/dist/mermaid-zenuml.core.mjs'; function b64ToUtf8(str) { return decodeURIComponent(escape(window.atob(str))); @@ -44,7 +45,7 @@ const contentLoaded = async function () { document.getElementsByTagName('body')[0].appendChild(div); } - await mermaid2.registerExternalDiagrams([externalExample]); + await mermaid2.registerExternalDiagrams([externalExample, zenUml]); mermaid2.initialize(graphObj.mermaid); await mermaid2.run(); }