mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-11-04 04:44:08 +01:00 
			
		
		
		
	Merge branch 'develop' into bug/#4497_unable-to-cherrypick-merge-commit
This commit is contained in:
		@@ -501,4 +501,16 @@ describe('Class diagram', () => {
 | 
			
		||||
        B : -methods()
 | 
			
		||||
      `);
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should handle notes with anchor tag having target attribute', () => {
 | 
			
		||||
    renderGraph(
 | 
			
		||||
      `classDiagram
 | 
			
		||||
        class test { }
 | 
			
		||||
        note for test "<a href='https://mermaid.js.org/' target="_blank"><code>note about mermaid</code></a>"`
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    cy.get('svg').then((svg) => {
 | 
			
		||||
      cy.get('a').should('have.attr', 'target', '_blank').should('have.attr', 'rel', 'noopener');
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
@@ -701,7 +701,117 @@ gitGraph TB:
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
  it('34: should render a simple gitgraph with cherry pick merge commit', () => {
 | 
			
		||||
  it('34: should render a simple gitgraph with two branches from same commit', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `gitGraph
 | 
			
		||||
      commit id:"1-abcdefg"
 | 
			
		||||
      commit id:"2-abcdefg"
 | 
			
		||||
      branch feature-001
 | 
			
		||||
      commit id:"3-abcdefg"
 | 
			
		||||
      commit id:"4-abcdefg"
 | 
			
		||||
      checkout main
 | 
			
		||||
      branch feature-002
 | 
			
		||||
      commit id:"5-abcdefg"
 | 
			
		||||
      checkout feature-001
 | 
			
		||||
      merge feature-002
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
  it('35: should render a simple gitgraph with two branches from same commit | Vertical Branch', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `gitGraph TB:
 | 
			
		||||
      commit id:"1-abcdefg"
 | 
			
		||||
      commit id:"2-abcdefg"
 | 
			
		||||
      branch feature-001
 | 
			
		||||
      commit id:"3-abcdefg"
 | 
			
		||||
      commit id:"4-abcdefg"
 | 
			
		||||
      checkout main
 | 
			
		||||
      branch feature-002
 | 
			
		||||
      commit id:"5-abcdefg"
 | 
			
		||||
      checkout feature-001
 | 
			
		||||
      merge feature-002
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
  it('36: should render GitGraph with branch that is not used immediately', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `gitGraph LR:
 | 
			
		||||
      commit id:"1-abcdefg"
 | 
			
		||||
      branch x
 | 
			
		||||
      checkout main
 | 
			
		||||
      commit id:"2-abcdefg"
 | 
			
		||||
      checkout x
 | 
			
		||||
      commit id:"3-abcdefg"
 | 
			
		||||
      checkout main
 | 
			
		||||
      merge x
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
  it('37: should render GitGraph with branch that is not used immediately | Vertical Branch', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `gitGraph TB:
 | 
			
		||||
      commit id:"1-abcdefg"
 | 
			
		||||
      branch x
 | 
			
		||||
      checkout main
 | 
			
		||||
      commit id:"2-abcdefg"
 | 
			
		||||
      checkout x
 | 
			
		||||
      commit id:"3-abcdefg"
 | 
			
		||||
      checkout main
 | 
			
		||||
      merge x
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
  it('38: should render GitGraph with branch and sub-branch neither of which used immediately', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `gitGraph LR:
 | 
			
		||||
      commit id:"1-abcdefg"
 | 
			
		||||
      branch x
 | 
			
		||||
      checkout main
 | 
			
		||||
      commit id:"2-abcdefg"
 | 
			
		||||
      checkout x
 | 
			
		||||
      commit id:"3-abcdefg"
 | 
			
		||||
      checkout main
 | 
			
		||||
      merge x
 | 
			
		||||
      checkout x
 | 
			
		||||
      branch y
 | 
			
		||||
      checkout x
 | 
			
		||||
      commit id:"4-abcdefg"
 | 
			
		||||
      checkout y
 | 
			
		||||
      commit id:"5-abcdefg"
 | 
			
		||||
      checkout x
 | 
			
		||||
      merge y
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
  it('39: should render GitGraph with branch and sub-branch neither of which used immediately | Vertical Branch', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `gitGraph TB:
 | 
			
		||||
      commit id:"1-abcdefg"
 | 
			
		||||
      branch x
 | 
			
		||||
      checkout main
 | 
			
		||||
      commit id:"2-abcdefg"
 | 
			
		||||
      checkout x
 | 
			
		||||
      commit id:"3-abcdefg"
 | 
			
		||||
      checkout main
 | 
			
		||||
      merge x
 | 
			
		||||
      checkout x
 | 
			
		||||
      branch y
 | 
			
		||||
      checkout x
 | 
			
		||||
      commit id:"4-abcdefg"
 | 
			
		||||
      checkout y
 | 
			
		||||
      commit id:"5-abcdefg"
 | 
			
		||||
      checkout x
 | 
			
		||||
      merge y
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
  it('40: should render a simple gitgraph with cherry pick merge commit', () => {
 | 
			
		||||
    imgSnapshotTest(
 | 
			
		||||
      `gitGraph
 | 
			
		||||
      commit id: "ZERO"
 | 
			
		||||
@@ -713,9 +823,7 @@ gitGraph TB:
 | 
			
		||||
      checkout main
 | 
			
		||||
      merge feature id: "M"
 | 
			
		||||
      checkout release
 | 
			
		||||
      cherry-pick id: "M" parent:"B"
 | 
			
		||||
      `,
 | 
			
		||||
      {}
 | 
			
		||||
      cherry-pick id: "M" parent:"B"`
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
@@ -58,10 +58,19 @@
 | 
			
		||||
  </head>
 | 
			
		||||
  <body>
 | 
			
		||||
    <pre id="diagram" class="mermaid">
 | 
			
		||||
flowchart-elk LR
 | 
			
		||||
   subgraph example
 | 
			
		||||
     node
 | 
			
		||||
   end
 | 
			
		||||
flowchart TB
 | 
			
		||||
    C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T & U & V & W & X & Y & Z & A1 & A2 & A3 & A4 & A5 & A6 & A7 & A8
 | 
			
		||||
      ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
 | 
			
		||||
    C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T & U & V & W & X & Y & Z & A1 & A2 & A3 & A4 & A5 & A6 & A7 & A8
 | 
			
		||||
 | 
			
		||||
    </pre>
 | 
			
		||||
    <pre id="diagram" class="mermaid2">
 | 
			
		||||
    flowchart TB
 | 
			
		||||
      A & A & A & A & A & A & A & A --->  C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T & U & V & W & X & Y & Z
 | 
			
		||||
    </pre>
 | 
			
		||||
    <pre id="diagram" class="mermaid2">
 | 
			
		||||
    flowchart TB
 | 
			
		||||
      A1 & A2 & A3 & A4 & A5 & A6 & A7 & A8 -->  C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T & U & V & W & X & Y & Z
 | 
			
		||||
    </pre>
 | 
			
		||||
    <pre id="diagram" class="mermaid2">
 | 
			
		||||
flowchart
 | 
			
		||||
@@ -441,6 +450,7 @@ mindmap
 | 
			
		||||
          messageFontFamily: 'courier',
 | 
			
		||||
        },
 | 
			
		||||
        fontSize: 16,
 | 
			
		||||
        logLevel: 0,
 | 
			
		||||
      });
 | 
			
		||||
      function callback() {
 | 
			
		||||
        alert('It worked');
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user