From 798f53f1f19d9286fe0850095587fc7060fb34bf Mon Sep 17 00:00:00 2001 From: kairi003 Date: Sun, 1 Dec 2024 12:23:02 +0900 Subject: [PATCH] Fix: flowchart-elk e2e test --- cypress/integration/rendering/flowchart-elk.spec.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cypress/integration/rendering/flowchart-elk.spec.js b/cypress/integration/rendering/flowchart-elk.spec.js index 38bfe6440e..f65af199d6 100644 --- a/cypress/integration/rendering/flowchart-elk.spec.js +++ b/cypress/integration/rendering/flowchart-elk.spec.js @@ -109,7 +109,7 @@ describe('Flowchart ELK', () => { const style = svg.attr('style'); expect(style).to.match(/^max-width: [\d.]+px;$/); const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join('')); - expect(maxWidthValue).to.be.within(230 * 0.95, 230 * 1.05); + expect(maxWidthValue).to.be.within(390 * 0.95, 390 * 1.05); }); }); it('8-elk: should render a flowchart when useMaxWidth is false', () => { @@ -128,7 +128,7 @@ describe('Flowchart ELK', () => { const width = parseFloat(svg.attr('width')); // use within because the absolute value can be slightly different depending on the environment ±5% // expect(height).to.be.within(446 * 0.95, 446 * 1.05); - expect(width).to.be.within(230 * 0.95, 230 * 1.05); + expect(width).to.be.within(390 * 0.95, 390 * 1.05); expect(svg).to.not.have.attr('style'); }); }); @@ -692,7 +692,7 @@ A --> B {} ); cy.get('svg').should((svg) => { - const edges = svg.querySelectorAll('.edges > path'); + const edges = svg[0].querySelectorAll('.edges > path'); edges.forEach((edge) => { expect(edge).to.have.class('flowchart-link'); }); @@ -743,10 +743,10 @@ NL\`") --"\`1o **bold**\`"--> c imgSnapshotTest( `%%{init: {"flowchart": {"htmlLabels": true}} }%% flowchart-elk LR -b(\`The dog in **the** hog.(1).. a a a a *very long text* about it +b("The dog in **the** hog.(1).. a a a a *very long text* about it Word! -Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. \`) --> c +Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. Another line with many, many words. ") --> c `, { flowchart: { titleTopMargin: 0 } } @@ -841,7 +841,7 @@ end { flowchart: { titleTopMargin: 0 } } ); }); - it('Sub graphs and markdown strings', () => { + it('Sub graphs and markdown strings2', () => { imgSnapshotTest( `--- config: