mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-11-03 20:34:20 +01:00 
			
		
		
		
	Reverting PR #2312
This commit is contained in:
		@@ -114,7 +114,7 @@ describe('Entity Relationship Diagram', () => {
 | 
			
		||||
    cy.get('svg')
 | 
			
		||||
      .should((svg) => {
 | 
			
		||||
        expect(svg).to.have.attr('width', '100%');
 | 
			
		||||
        expect(svg).to.have.attr('height', '100%');
 | 
			
		||||
        expect(svg).to.have.attr('height', '465');
 | 
			
		||||
        const style = svg.attr('style');
 | 
			
		||||
        expect(style).to.match(/^max-width: [\d.]+px;$/);
 | 
			
		||||
        const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
 | 
			
		||||
@@ -174,7 +174,7 @@ describe('Entity Relationship Diagram', () => {
 | 
			
		||||
    renderGraph(
 | 
			
		||||
      `
 | 
			
		||||
    erDiagram
 | 
			
		||||
        PRIVATE_FINANCIAL_INSTITUTION {
 | 
			
		||||
        PRIVATE_FINANCIAL_INSTITUTION { 
 | 
			
		||||
          string name
 | 
			
		||||
          int    turnover
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -94,7 +94,10 @@ describe('Flowchart v2', () => {
 | 
			
		||||
    cy.get('svg')
 | 
			
		||||
      .should((svg) => {
 | 
			
		||||
        expect(svg).to.have.attr('width', '100%');
 | 
			
		||||
        expect(svg).to.have.attr('height', '100%');
 | 
			
		||||
        expect(svg).to.have.attr('height');
 | 
			
		||||
        // use within because the absolute value can be slightly different depending on the environment ±5%
 | 
			
		||||
        const height = parseFloat(svg.attr('height'));
 | 
			
		||||
        expect(height).to.be.within(446 * .95, 446 * 1.05);
 | 
			
		||||
        const style = svg.attr('style');
 | 
			
		||||
        expect(style).to.match(/^max-width: [\d.]+px;$/);
 | 
			
		||||
        const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
 | 
			
		||||
 
 | 
			
		||||
@@ -745,7 +745,10 @@ describe('Graph', () => {
 | 
			
		||||
    cy.get('svg')
 | 
			
		||||
      .should((svg) => {
 | 
			
		||||
        expect(svg).to.have.attr('width', '100%');
 | 
			
		||||
        expect(svg).to.have.attr('height', '100%');
 | 
			
		||||
        expect(svg).to.have.attr('height');
 | 
			
		||||
        // use within because the absolute value can be slightly different depending on the environment ±5%
 | 
			
		||||
        const height = parseFloat(svg.attr('height'));
 | 
			
		||||
        expect(height).to.be.within(446 * .95, 446 * 1.05);
 | 
			
		||||
        const style = svg.attr('style');
 | 
			
		||||
        expect(style).to.match(/^max-width: [\d.]+px;$/);
 | 
			
		||||
        const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
 | 
			
		||||
 
 | 
			
		||||
@@ -202,7 +202,10 @@ describe('Gantt diagram', () => {
 | 
			
		||||
    cy.get('svg')
 | 
			
		||||
      .should((svg) => {
 | 
			
		||||
        expect(svg).to.have.attr('width', '100%');
 | 
			
		||||
        expect(svg).to.have.attr('height', '100%');
 | 
			
		||||
        expect(svg).to.have.attr('height');
 | 
			
		||||
        // use within because the absolute value can be slightly different depending on the environment ±5%
 | 
			
		||||
        const height = parseFloat(svg.attr('height'));
 | 
			
		||||
        expect(height).to.be.within(484 * .95, 484 * 1.05);
 | 
			
		||||
        const style = svg.attr('style');
 | 
			
		||||
        expect(style).to.match(/^max-width: [\d.]+px;$/);
 | 
			
		||||
        const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
 | 
			
		||||
 
 | 
			
		||||
@@ -50,7 +50,9 @@ describe('Pie Chart', () => {
 | 
			
		||||
    cy.get('svg')
 | 
			
		||||
      .should((svg) => {
 | 
			
		||||
        expect(svg).to.have.attr('width', '100%');
 | 
			
		||||
        expect(svg).to.have.attr('height', '100%');
 | 
			
		||||
        expect(svg).to.have.attr('height');
 | 
			
		||||
        const height = parseFloat(svg.attr('height'));
 | 
			
		||||
        expect(height).to.eq(450);
 | 
			
		||||
        const style = svg.attr('style');
 | 
			
		||||
        expect(style).to.match(/^max-width: [\d.]+px;$/);
 | 
			
		||||
        const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
 | 
			
		||||
 
 | 
			
		||||
@@ -635,7 +635,9 @@ context('Sequence diagram', () => {
 | 
			
		||||
      cy.get('svg')
 | 
			
		||||
        .should((svg) => {
 | 
			
		||||
          expect(svg).to.have.attr('width', '100%');
 | 
			
		||||
          expect(svg).to.have.attr('height', '100%');
 | 
			
		||||
          expect(svg).to.have.attr('height');
 | 
			
		||||
          const height = parseFloat(svg.attr('height'));
 | 
			
		||||
          expect(height).to.be.within(920, 960);
 | 
			
		||||
          const style = svg.attr('style');
 | 
			
		||||
          expect(style).to.match(/^max-width: [\d.]+px;$/);
 | 
			
		||||
          const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
 | 
			
		||||
 
 | 
			
		||||
@@ -450,7 +450,9 @@ stateDiagram-v2
 | 
			
		||||
    cy.get('svg')
 | 
			
		||||
      .should((svg) => {
 | 
			
		||||
        expect(svg).to.have.attr('width', '100%');
 | 
			
		||||
        expect(svg).to.have.attr('height', '100%');
 | 
			
		||||
        expect(svg).to.have.attr('height');
 | 
			
		||||
        const height = parseFloat(svg.attr('height'));
 | 
			
		||||
        expect(height).to.be.within(177, 178);
 | 
			
		||||
        const style = svg.attr('style');
 | 
			
		||||
        expect(style).to.match(/^max-width: [\d.]+px;$/);
 | 
			
		||||
        const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
 | 
			
		||||
 
 | 
			
		||||
@@ -356,7 +356,9 @@ describe('State diagram', () => {
 | 
			
		||||
    cy.get('svg')
 | 
			
		||||
      .should((svg) => {
 | 
			
		||||
        expect(svg).to.have.attr('width', '100%');
 | 
			
		||||
        expect(svg).to.have.attr('height', '100%');
 | 
			
		||||
        expect(svg).to.have.attr('height');
 | 
			
		||||
        const height = parseFloat(svg.attr('height'));
 | 
			
		||||
        expect(height).to.be.within(176,178);
 | 
			
		||||
        const style = svg.attr('style');
 | 
			
		||||
        expect(style).to.match(/^max-width: [\d.]+px;$/);
 | 
			
		||||
        const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user