Skip to content

Commit

Permalink
GitGraph: Added e2e tests for deferred branch use.
Browse files Browse the repository at this point in the history
In these tests, a new branch is created but then a commit is made
on the main branch before the new branch gets a commit. This
important to see what happens with rerouting of arrows.

Suggested by @nirname in PR review of mermaid-js#4927.
  • Loading branch information
guypursey committed Oct 24, 2023
1 parent a8e544f commit 8620d3a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions cypress/integration/rendering/gitGraph.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,4 +735,34 @@ gitGraph TB:
{}
);
});
it('36: should render GitGraph with branch that is not used immediately', () => {
imgSnapshotTest(
`gitGraph LR:
commit
branch x
checkout main
commit
checkout x
commit
checkout main
merge x
`,
{}
);
});
it('37: should render GitGraph with branch that is not used immediately | Vertical Branch', () => {
imgSnapshotTest(
`gitGraph TB:
commit
branch x
checkout main
commit
checkout x
commit
checkout main
merge x
`,
{}
);
});
});

0 comments on commit 8620d3a

Please sign in to comment.