From a25c9a30d0fa51a5e84b499595489c9d495b14ae Mon Sep 17 00:00:00 2001 From: Alois Klink Date: Wed, 14 Sep 2022 03:50:03 +0100 Subject: [PATCH] text(e2e): give git tests consistent commit id gitGraph render tests are currently using random commit ids, which causes visual regression tests to fail. I couldn't find a way to make the random commit IDs consistent (JavaScript/Cypress doesn't seem to have a random.seed() function), so I've just hardcoded all the commit ids. --- .../integration/rendering/gitGraph.spec.js | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/cypress/integration/rendering/gitGraph.spec.js b/cypress/integration/rendering/gitGraph.spec.js index 80981c31c..b0d65d0cc 100644 --- a/cypress/integration/rendering/gitGraph.spec.js +++ b/cypress/integration/rendering/gitGraph.spec.js @@ -213,42 +213,43 @@ describe('Git Graph diagram', () => { ` gitGraph checkout main - commit + %% Make sure to manually set the ID of all commits, for consistent visual tests + commit id: "1-abcdefg" checkout main branch branch1 - commit + commit id: "2-abcdefg" checkout main merge branch1 branch branch2 - commit + commit id: "3-abcdefg" checkout main merge branch2 branch branch3 - commit + commit id: "4-abcdefg" checkout main merge branch3 branch branch4 - commit + commit id: "5-abcdefg" checkout main merge branch4 branch branch5 - commit + commit id: "6-abcdefg" checkout main merge branch5 branch branch6 - commit + commit id: "7-abcdefg" checkout main merge branch6 branch branch7 - commit + commit id: "8-abcdefg" checkout main merge branch7 branch branch8 - commit + commit id: "9-abcdefg" checkout main merge branch8 branch branch9 - commit + commit id: "10-abcdefg" `, {} );