mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-11-04 04:44:08 +01:00 
			
		
		
		
	Merge branch 'develop' into 5367/architecture-diagram
This commit is contained in:
		@@ -321,4 +321,37 @@ ORDER ||--|{ LINE-ITEM : contains
 | 
			
		||||
      { logLevel: 1 }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should render relationship labels with line breaks', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `
 | 
			
		||||
    erDiagram
 | 
			
		||||
      p[Person] {
 | 
			
		||||
          string firstName
 | 
			
		||||
          string lastName
 | 
			
		||||
      }
 | 
			
		||||
      a["Customer Account"] {
 | 
			
		||||
          string email
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      b["Customer Account Secondary"] {
 | 
			
		||||
        string email
 | 
			
		||||
      }
 | 
			
		||||
      
 | 
			
		||||
      c["Customer Account Tertiary"] {
 | 
			
		||||
        string email
 | 
			
		||||
      }
 | 
			
		||||
      
 | 
			
		||||
      d["Customer Account Nth"] {
 | 
			
		||||
        string email
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      p ||--o| a : "has<br />one"
 | 
			
		||||
      p ||--o| b : "has<br />one<br />two"
 | 
			
		||||
      p ||--o| c : "has<br />one<br/>two<br />three"
 | 
			
		||||
      p ||--o| d : "has<br />one<br />two<br/>three<br />...<br/>Nth"
 | 
			
		||||
      `,
 | 
			
		||||
      { logLevel: 1 }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
@@ -12,7 +12,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        flowchart: { htmlLabels: false },
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
      }
 | 
			
		||||
@@ -30,7 +30,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        flowchart: { htmlLabels: true },
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
      }
 | 
			
		||||
@@ -47,7 +47,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      C -->|Two| E[iPhone]
 | 
			
		||||
      C -->|Three| F[Car]
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, fontFamily: 'courier' }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, fontFamily: 'courier' }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -62,7 +62,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      C -->|Two| E[\\iPhone\\]
 | 
			
		||||
      C -->|Three| F[Car]
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, fontFamily: 'courier' }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, fontFamily: 'courier' }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -78,7 +78,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      classDef processHead fill:#888888,color:white,font-weight:bold,stroke-width:3px,stroke:#001f3f
 | 
			
		||||
      class 1A,1B,D,E processHead
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, fontFamily: 'courier' }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, fontFamily: 'courier' }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -107,7 +107,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      35(SAM.CommonFA.PopulationFME)-->39(SAM.CommonFA.ChargeDetails)
 | 
			
		||||
      36(SAM.CommonFA.PremetricCost)-->39(SAM.CommonFA.ChargeDetails)
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, fontFamily: 'courier' }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, fontFamily: 'courier' }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -178,7 +178,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      9a072290_1ec3_e711_8c5a_005056ad0002-->d6072290_1ec3_e711_8c5a_005056ad0002
 | 
			
		||||
      9a072290_1ec3_e711_8c5a_005056ad0002-->71082290_1ec3_e711_8c5a_005056ad0002
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, fontFamily: 'courier' }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, fontFamily: 'courier' }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -187,7 +187,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `
 | 
			
		||||
    graph TB;subgraph "number as labels";1;end;
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, fontFamily: 'courier' }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, fontFamily: 'courier' }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -199,7 +199,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
        a1-->a2
 | 
			
		||||
      end
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, fontFamily: 'courier' }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, fontFamily: 'courier' }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -211,7 +211,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
        a1-->a2
 | 
			
		||||
      end
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, fontFamily: 'courier' }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, fontFamily: 'courier' }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -246,7 +246,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      style foo fill:#F99,stroke-width:2px,stroke:#F0F,color:darkred
 | 
			
		||||
      style bar fill:#999,stroke-width:10px,stroke:#0F0,color:blue
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, fontFamily: 'courier' }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, fontFamily: 'courier' }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -348,7 +348,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      sid-7CE72B24-E0C1-46D3-8132-8BA66BE05AA7-->sid-4DA958A0-26D9-4D47-93A7-70F39FD7D51A;
 | 
			
		||||
      sid-7CE72B24-E0C1-46D3-8132-8BA66BE05AA7-->sid-4FC27B48-A6F9-460A-A675-021F5854FE22;
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, fontFamily: 'courier' }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, fontFamily: 'courier' }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -364,7 +364,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        listUrl: false,
 | 
			
		||||
        listId: 'color styling',
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
@@ -390,7 +390,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        listUrl: false,
 | 
			
		||||
        listId: 'color styling',
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
@@ -411,7 +411,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        flowchart: { htmlLabels: false },
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
      }
 | 
			
		||||
@@ -435,7 +435,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        flowchart: { htmlLabels: false },
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
      }
 | 
			
		||||
@@ -457,7 +457,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        flowchart: { htmlLabels: false },
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
      }
 | 
			
		||||
@@ -471,7 +471,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        flowchart: { htmlLabels: false },
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
      }
 | 
			
		||||
@@ -485,7 +485,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        flowchart: { htmlLabels: false },
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
      }
 | 
			
		||||
@@ -500,7 +500,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        flowchart: { htmlLabels: false },
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
      }
 | 
			
		||||
@@ -527,7 +527,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      class A someclass;`,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        flowchart: { htmlLabels: false },
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
      }
 | 
			
		||||
@@ -544,7 +544,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      C -->|Two| E[iPhone]
 | 
			
		||||
      C -->|Three| F[fa:fa-car Car]
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, flowchart: { nodeSpacing: 50 }, fontFamily: 'courier' }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, flowchart: { nodeSpacing: 50 }, fontFamily: 'courier' }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -560,7 +560,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        flowchart: { rankSpacing: '100' },
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
      }
 | 
			
		||||
@@ -578,7 +578,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        flowchart: { htmlLabels: false },
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
      }
 | 
			
		||||
@@ -603,7 +603,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      click E "notes://do-your-thing/id" "other protocol test"
 | 
			
		||||
      click F "javascript:alert('test')" "script test"
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, securityLevel: 'loose', fontFamily: 'courier' }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, securityLevel: 'loose', fontFamily: 'courier' }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -623,7 +623,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      click B "index.html#link-clicked" "link test"
 | 
			
		||||
      click D testClick "click test"
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, flowchart: { htmlLabels: true } }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, flowchart: { htmlLabels: true } }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -645,7 +645,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        flowchart: { htmlLabels: false },
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
      }
 | 
			
		||||
@@ -664,7 +664,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      class A myClass1
 | 
			
		||||
      class D myClass2
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, flowchart: { htmlLabels: true } }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, flowchart: { htmlLabels: true } }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -682,7 +682,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        flowchart: { htmlLabels: false },
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
      }
 | 
			
		||||
@@ -711,7 +711,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        flowchart: { htmlLabels: false },
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
      }
 | 
			
		||||
@@ -728,7 +728,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        flowchart: { htmlLabels: false },
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
      }
 | 
			
		||||
@@ -752,7 +752,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        flowchart: { htmlLabels: false },
 | 
			
		||||
        fontFamily: 'courier',
 | 
			
		||||
      }
 | 
			
		||||
@@ -769,7 +769,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      C -->|Two| E[iPhone]
 | 
			
		||||
      C -->|Three| F[fa:fa-car Car]
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, flowchart: { diagramPadding: 0 } }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, flowchart: { diagramPadding: 0 } }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -778,7 +778,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `graph TD
 | 
			
		||||
      A[Christmas]
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0 }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1 }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -796,7 +796,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      C -----> E4
 | 
			
		||||
      C ======> E5
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0 }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1 }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
  it('FDH36: should render escaped without html labels', () => {
 | 
			
		||||
@@ -804,7 +804,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `graph TD
 | 
			
		||||
        a["<strong>Haiya</strong>"]-->b
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, htmlLabels: false, flowchart: { htmlLabels: false } }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, htmlLabels: false, flowchart: { htmlLabels: false } }
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
  it('FDH37: should render non-escaped with html labels', () => {
 | 
			
		||||
@@ -814,7 +814,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        htmlLabels: true,
 | 
			
		||||
        flowchart: { htmlLabels: true },
 | 
			
		||||
        securityLevel: 'loose',
 | 
			
		||||
@@ -830,7 +830,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      C -->|Two| E[iPhone]
 | 
			
		||||
      C -->|Three| F[fa:fa-car Car]
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, flowchart: { useMaxWidth: true } }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, flowchart: { useMaxWidth: true } }
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg').should((svg) => {
 | 
			
		||||
      expect(svg).to.have.attr('width', '100%');
 | 
			
		||||
@@ -853,7 +853,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      C -->|Two| E[iPhone]
 | 
			
		||||
      C -->|Three| F[fa:fa-car Car]
 | 
			
		||||
      `,
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 0, flowchart: { useMaxWidth: false } }
 | 
			
		||||
      { look: 'handDrawn', handDrawnSeed: 1, flowchart: { useMaxWidth: false } }
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg').should((svg) => {
 | 
			
		||||
      // const height = parseFloat(svg.attr('height'));
 | 
			
		||||
@@ -874,7 +874,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        htmlLabels: true,
 | 
			
		||||
        flowchart: { htmlLabels: true },
 | 
			
		||||
        securityLevel: 'loose',
 | 
			
		||||
@@ -904,7 +904,7 @@ describe('Flowchart HandDrawn', () => {
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        htmlLabels: true,
 | 
			
		||||
        flowchart: { htmlLabels: true },
 | 
			
		||||
        securityLevel: 'loose',
 | 
			
		||||
@@ -919,7 +919,7 @@ graph TD
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        htmlLabels: true,
 | 
			
		||||
        flowchart: { htmlLabels: true },
 | 
			
		||||
        securityLevel: 'loose',
 | 
			
		||||
@@ -937,7 +937,7 @@ graph TD
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        htmlLabels: true,
 | 
			
		||||
        flowchart: { htmlLabels: true },
 | 
			
		||||
        securityLevel: 'loose',
 | 
			
		||||
@@ -977,7 +977,7 @@ graph TD
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        htmlLabels: true,
 | 
			
		||||
        flowchart: { htmlLabels: true },
 | 
			
		||||
        securityLevel: 'loose',
 | 
			
		||||
@@ -999,7 +999,7 @@ graph TD
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        htmlLabels: true,
 | 
			
		||||
        flowchart: { htmlLabels: true },
 | 
			
		||||
        securityLevel: 'loose',
 | 
			
		||||
@@ -1016,7 +1016,7 @@ graph TD
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        htmlLabels: true,
 | 
			
		||||
        flowchart: { htmlLabels: true },
 | 
			
		||||
        securityLevel: 'loose',
 | 
			
		||||
@@ -1027,12 +1027,12 @@ graph TD
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `
 | 
			
		||||
      graph TD
 | 
			
		||||
        classDef default fill:#a34,stroke:#000,stroke-width:4px,color:#fff 
 | 
			
		||||
        classDef default fill:#a34,stroke:#000,stroke-width:4px,color:#fff
 | 
			
		||||
        hello --> default
 | 
			
		||||
      `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        htmlLabels: true,
 | 
			
		||||
        flowchart: { htmlLabels: true },
 | 
			
		||||
        securityLevel: 'loose',
 | 
			
		||||
@@ -1051,7 +1051,7 @@ graph TD
 | 
			
		||||
    `,
 | 
			
		||||
      {
 | 
			
		||||
        look: 'handDrawn',
 | 
			
		||||
        handDrawnSeed: 0,
 | 
			
		||||
        handDrawnSeed: 1,
 | 
			
		||||
        flowchart: { htmlLabels: true },
 | 
			
		||||
        securityLevel: 'loose',
 | 
			
		||||
      }
 | 
			
		||||
 
 | 
			
		||||
@@ -99,7 +99,7 @@ describe('Flowchart v2', () => {
 | 
			
		||||
      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(446 * 0.95 - 1, 446 * 1.05);
 | 
			
		||||
      expect(maxWidthValue).to.be.within(417 * 0.95, 417 * 1.05);
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
  it('8: should render a flowchart when useMaxWidth is false', () => {
 | 
			
		||||
@@ -118,7 +118,7 @@ describe('Flowchart v2', () => {
 | 
			
		||||
      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(446 * 0.95 - 1, 446 * 1.05);
 | 
			
		||||
      expect(width).to.be.within(417 * 0.95, 417 * 1.05);
 | 
			
		||||
      expect(svg).to.not.have.attr('style');
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user