From e9bbd816de073d4d9250af2aa16876eec54e6de3 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 13 Jul 2023 13:16:41 +0200 Subject: [PATCH] Make bisect/basic.go test more concrete - check out a non-main branch before we start - add authors to expected commits so that we can see whether the commits show an asterisk - explicitly check what the top line displays after bisecting has started This shows that the detached head shows an asterisk, which we don't want. We'll fix that in the next commit. --- pkg/integration/tests/bisect/basic.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/integration/tests/bisect/basic.go b/pkg/integration/tests/bisect/basic.go index e17f0d50f..1dfe6368b 100644 --- a/pkg/integration/tests/bisect/basic.go +++ b/pkg/integration/tests/bisect/basic.go @@ -11,6 +11,7 @@ var Basic = NewIntegrationTest(NewIntegrationTestArgs{ Skip: false, SetupRepo: func(shell *Shell) { shell. + NewBranch("mybranch"). CreateNCommits(10) }, SetupConfig: func(cfg *config.AppConfig) {}, @@ -31,20 +32,21 @@ var Basic = NewIntegrationTest(NewIntegrationTestArgs{ t.Views().Commits(). Focus(). - SelectedLine(Contains("commit 10")). - NavigateToLine(Contains("commit 09")). + SelectedLine(Contains("CI commit 10")). + NavigateToLine(Contains("CI commit 09")). Tap(func() { markCommitAsBad() t.Views().Information().Content(Contains("Bisecting")) }). SelectedLine(Contains("<-- bad")). - NavigateToLine(Contains("commit 02")). + NavigateToLine(Contains("CI commit 02")). Tap(markCommitAsGood). + TopLines(Contains("CI commit 10")). // lazygit will land us in the commit between our good and bad commits. - SelectedLine(Contains("commit 05").Contains("<-- current")). + SelectedLine(Contains("CI commit 05").Contains("<-- current")). Tap(markCommitAsBad). - SelectedLine(Contains("commit 04").Contains("<-- current")). + SelectedLine(Contains("CI commit 04").Contains("<-- current")). Tap(func() { markCommitAsGood() @@ -52,7 +54,7 @@ var Basic = NewIntegrationTest(NewIntegrationTestArgs{ t.ExpectPopup().Alert().Title(Equals("Bisect complete")).Content(MatchesRegexp("(?s)commit 05.*Do you want to reset")).Confirm() }). IsFocused(). - Content(Contains("commit 04")) + Content(Contains("CI commit 04")) t.Views().Information().Content(DoesNotContain("Bisecting")) },