mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-11-04 04:44:08 +01:00 
			
		
		
		
	Merge branch 'develop' of https://github.com/mermaid-js/mermaid into feature/2776_katex_math
This commit is contained in:
		@@ -134,7 +134,7 @@ graph TD
 | 
			
		||||
      const url = 'http://localhost:9000/theme-directives.html';
 | 
			
		||||
      cy.visit(url);
 | 
			
		||||
      cy.get('svg');
 | 
			
		||||
      cy.percySnapshot();
 | 
			
		||||
      cy.matchImageSnapshot('conf-and-directives.spec-when-rendering-several-diagrams-diagram-1');
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
@@ -1,20 +1,105 @@
 | 
			
		||||
import { imgSnapshotTest } from '../../helpers/util.js';
 | 
			
		||||
 | 
			
		||||
describe('Sequencediagram', () => {
 | 
			
		||||
  // it('should render a simple git graph', () => {
 | 
			
		||||
  //   imgSnapshotTest(
 | 
			
		||||
  //     `
 | 
			
		||||
  //   gitGraph:
 | 
			
		||||
  //     commit
 | 
			
		||||
  //     branch newbranch
 | 
			
		||||
  //     checkout newbranch
 | 
			
		||||
  //     commit
 | 
			
		||||
  //     commit
 | 
			
		||||
  //     checkout master
 | 
			
		||||
  //     commit
 | 
			
		||||
  //     commit
 | 
			
		||||
  //     merge newbranch`,
 | 
			
		||||
  //     { logLevel: 0 }
 | 
			
		||||
  //   );
 | 
			
		||||
  // });
 | 
			
		||||
describe('Git Graph diagram', () => {
 | 
			
		||||
  it('1: should render a simple gitgraph with commit on main branch', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `gitGraph
 | 
			
		||||
       commit id: "1"
 | 
			
		||||
       commit id: "2"
 | 
			
		||||
       commit id: "3"
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
  it('2: should render a simple gitgraph with commit on main branch with Id', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `gitGraph
 | 
			
		||||
       commit id: "One"
 | 
			
		||||
       commit id: "Two"
 | 
			
		||||
       commit id: "Three"
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
  it('3: should render a simple gitgraph with different commitTypes on main branch ', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `gitGraph
 | 
			
		||||
       commit id: "Normal Commit"
 | 
			
		||||
       commit id: "Reverse Commit" type: REVERSE
 | 
			
		||||
       commit id: "Hightlight Commit" type: HIGHLIGHT
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
  it('4: should render a simple gitgraph with tags commitTypes on main branch ', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `gitGraph
 | 
			
		||||
       commit id: "Normal Commit with tag" tag: "v1.0.0"
 | 
			
		||||
       commit id: "Reverse Commit with tag" type: REVERSE tag: "RC_1"
 | 
			
		||||
       commit id: "Hightlight Commit" type: HIGHLIGHT  tag: "8.8.4"
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
  it('5: should render a simple gitgraph with two branches', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `gitGraph
 | 
			
		||||
       commit id: "1"
 | 
			
		||||
       commit id: "2"
 | 
			
		||||
       branch develop
 | 
			
		||||
       checkout develop
 | 
			
		||||
       commit id: "3"
 | 
			
		||||
       commit id: "4"
 | 
			
		||||
       checkout main
 | 
			
		||||
       commit id: "5"
 | 
			
		||||
       commit id: "6"
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
  it('6: should render a simple gitgraph with two branches and merge commit', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `gitGraph
 | 
			
		||||
       commit id: "1"
 | 
			
		||||
       commit id: "2"
 | 
			
		||||
       branch develop
 | 
			
		||||
       checkout develop
 | 
			
		||||
       commit id: "3"
 | 
			
		||||
       commit id: "4"
 | 
			
		||||
       checkout main
 | 
			
		||||
       merge develop
 | 
			
		||||
       commit id: "5"
 | 
			
		||||
       commit id: "6"
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
  it('7: should render a simple gitgraph with three branches and merge commit', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `gitGraph
 | 
			
		||||
       commit id: "1"
 | 
			
		||||
       commit id: "2"
 | 
			
		||||
       branch nice_feature
 | 
			
		||||
       checkout nice_feature
 | 
			
		||||
       commit id: "3"
 | 
			
		||||
       checkout main
 | 
			
		||||
       commit id: "4"
 | 
			
		||||
       checkout nice_feature
 | 
			
		||||
       branch very_nice_feature
 | 
			
		||||
       checkout very_nice_feature
 | 
			
		||||
       commit id: "5"
 | 
			
		||||
       checkout main
 | 
			
		||||
       commit id: "6"
 | 
			
		||||
       checkout nice_feature
 | 
			
		||||
       commit id: "7"
 | 
			
		||||
       checkout main
 | 
			
		||||
       merge nice_feature
 | 
			
		||||
       checkout very_nice_feature
 | 
			
		||||
       commit id: "8"
 | 
			
		||||
       checkout main
 | 
			
		||||
       commit id: "9"
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
@@ -552,7 +552,7 @@ context('Sequence diagram', () => {
 | 
			
		||||
        }
 | 
			
		||||
      );
 | 
			
		||||
    });
 | 
			
		||||
    it('should override config with directive settings', () => {
 | 
			
		||||
    it('should override config with directive settings 2', () => {
 | 
			
		||||
      imgSnapshotTest(
 | 
			
		||||
        `
 | 
			
		||||
        %%{init: { "config": { "mirrorActors": false, "wrap": true }}}%%
 | 
			
		||||
 
 | 
			
		||||
@@ -158,7 +158,7 @@ describe('State diagram', () => {
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
  it('v2 should render a simple state diagrams', () => {
 | 
			
		||||
  it('v2 should render a simple state diagrams 2', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `
 | 
			
		||||
    stateDiagram-v2
 | 
			
		||||
 
 | 
			
		||||
@@ -148,7 +148,7 @@ describe('State diagram', () => {
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
  it('should render a simple state diagrams', () => {
 | 
			
		||||
  it('should render a simple state diagrams 2', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `
 | 
			
		||||
    stateDiagram
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user