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 26, 2023
1 parent add8867 commit e097635
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 e097635

Please sign in to comment.