Fix flowchart-elk render test

This commit is contained in:
Sidharth Vinod 2024-03-23 15:12:48 +05:30
parent 100123b43e
commit 8f8e4806a9
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD
2 changed files with 5 additions and 2 deletions

View File

@ -853,7 +853,8 @@ describe('Title and arrow styling #4813', () => {
title: ${titleString} title: ${titleString}
--- ---
flowchart LR flowchart LR
A-->B`, A-->B
A-->C`,
{ flowchart: { defaultRenderer: 'elk' } } { flowchart: { defaultRenderer: 'elk' } }
); );
cy.get('svg').should((svg) => { cy.get('svg').should((svg) => {
@ -874,6 +875,7 @@ describe('Title and arrow styling #4813', () => {
); );
cy.get('svg').should((svg) => { cy.get('svg').should((svg) => {
const edges = svg[0].querySelectorAll('.edges path'); const edges = svg[0].querySelectorAll('.edges path');
console.log(edges);
expect(edges[0]).to.have.attr('pattern', 'solid'); expect(edges[0]).to.have.attr('pattern', 'solid');
expect(edges[1]).to.have.attr('pattern', 'dotted'); expect(edges[1]).to.have.attr('pattern', 'dotted');
expect(edges[2]).to.have.css('stroke-width', '3.5px'); expect(edges[2]).to.have.css('stroke-width', '3.5px');

View File

@ -1,4 +1,5 @@
import mermaid from './mermaid.esm.mjs'; import mermaid from './mermaid.esm.mjs';
import flowchartELK from './mermaid-flowchart-elk.esm.mjs';
import externalExample from './mermaid-example-diagram.esm.mjs'; import externalExample from './mermaid-example-diagram.esm.mjs';
import zenUml from './mermaid-zenuml.esm.mjs'; import zenUml from './mermaid-zenuml.esm.mjs';
@ -45,7 +46,7 @@ const contentLoaded = async function () {
document.getElementsByTagName('body')[0].appendChild(div); document.getElementsByTagName('body')[0].appendChild(div);
} }
await mermaid.registerExternalDiagrams([externalExample, zenUml]); await mermaid.registerExternalDiagrams([externalExample, zenUml, flowchartELK]);
mermaid.initialize(graphObj.mermaid); mermaid.initialize(graphObj.mermaid);
await mermaid.run(); await mermaid.run();
} }