1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-31 23:19:40 +02:00

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.
This commit is contained in:
Stefan Haller 2023-07-13 13:16:41 +02:00
parent eb6f089a2a
commit e9bbd816de

View File

@ -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"))
},