From adfe1728ae2850d1a36ac65187ada5302beb0c6b Mon Sep 17 00:00:00 2001 From: Guy Pursey Date: Mon, 23 Oct 2023 10:12:28 +0100 Subject: [PATCH] GitGraph: Added e2e tests for deferred branch use. 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 #4927. --- .../integration/rendering/gitGraph.spec.js | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/cypress/integration/rendering/gitGraph.spec.js b/cypress/integration/rendering/gitGraph.spec.js index ea7b48407..e232aaca2 100644 --- a/cypress/integration/rendering/gitGraph.spec.js +++ b/cypress/integration/rendering/gitGraph.spec.js @@ -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 + `, + {} + ); + }); });