summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/bisect
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-12-27 21:25:11 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-12-27 21:26:18 +1100
commit53e06b71aecd2ddaf80516627ba223ac2adc5420 (patch)
treed45e564eb6718d9a9431aede2ed4a8f52911d1de /pkg/integration/tests/bisect
parentb166b8f776e45c77a94b6e919f3b9460ff3c2e06 (diff)
add tap function
Diffstat (limited to 'pkg/integration/tests/bisect')
-rw-r--r--pkg/integration/tests/bisect/basic.go44
-rw-r--r--pkg/integration/tests/bisect/from_other_branch.go24
2 files changed, 31 insertions, 37 deletions
diff --git a/pkg/integration/tests/bisect/basic.go b/pkg/integration/tests/bisect/basic.go
index 131672654..ac4953095 100644
--- a/pkg/integration/tests/bisect/basic.go
+++ b/pkg/integration/tests/bisect/basic.go
@@ -38,34 +38,28 @@ var Basic = NewIntegrationTest(NewIntegrationTestArgs{
input.Views().Commits().
Focus().
SelectedLine(Contains("commit 10")).
- NavigateToListItem(Contains("commit 09"))
+ NavigateToListItem(Contains("commit 09")).
+ Tap(func() {
+ markCommitAsBad()
- markCommitAsBad()
-
- input.Views().Information().Content(Contains("bisecting"))
-
- input.Views().Commits().
- IsFocused().
+ input.Views().Information().Content(Contains("bisecting"))
+ }).
SelectedLine(Contains("<-- bad")).
- NavigateToListItem(Contains("commit 02"))
-
- markCommitAsGood()
-
- // lazygit will land us in the commit between our good and bad commits.
- input.Views().Commits().IsFocused().
- SelectedLine(Contains("commit 05").Contains("<-- current"))
-
- markCommitAsBad()
-
- input.Views().Commits().IsFocused().
- SelectedLine(Contains("commit 04").Contains("<-- current"))
-
- markCommitAsGood()
-
- // commit 5 is the culprit because we marked 4 as good and 5 as bad.
- input.ExpectAlert().Title(Equals("Bisect complete")).Content(MatchesRegexp("(?s)commit 05.*Do you want to reset")).Confirm()
+ NavigateToListItem(Contains("commit 02")).
+ Tap(markCommitAsGood).
+ // lazygit will land us in the commit between our good and bad commits.
+ SelectedLine(Contains("commit 05").Contains("<-- current")).
+ Tap(markCommitAsBad).
+ SelectedLine(Contains("commit 04").Contains("<-- current")).
+ Tap(func() {
+ markCommitAsGood()
+
+ // commit 5 is the culprit because we marked 4 as good and 5 as bad.
+ input.ExpectAlert().Title(Equals("Bisect complete")).Content(MatchesRegexp("(?s)commit 05.*Do you want to reset")).Confirm()
+ }).
+ IsFocused().
+ Content(Contains("commit 04"))
- input.Views().Commits().IsFocused().Content(Contains("commit 04"))
input.Views().Information().Content(DoesNotContain("bisecting"))
},
})
diff --git a/pkg/integration/tests/bisect/from_other_branch.go b/pkg/integration/tests/bisect/from_other_branch.go
index 0112d7da5..20f0fb646 100644
--- a/pkg/integration/tests/bisect/from_other_branch.go
+++ b/pkg/integration/tests/bisect/from_other_branch.go
@@ -36,17 +36,17 @@ var FromOtherBranch = NewIntegrationTest(NewIntegrationTestArgs{
MatchesRegexp(`<-- good.*commit 05`),
).
SelectNextItem().
- Press(keys.Commits.ViewBisectOptions)
-
- input.ExpectMenu().Title(Equals("Bisect")).Select(MatchesRegexp(`mark .* as good`)).Confirm()
-
- input.ExpectAlert().Title(Equals("Bisect complete")).Content(MatchesRegexp("(?s)commit 08.*Do you want to reset")).Confirm()
-
- input.Views().Information().Content(DoesNotContain("bisecting"))
-
- // back in master branch which just had the one commit
- input.Views().Commits().Lines(
- Contains("only commit on master"),
- )
+ Press(keys.Commits.ViewBisectOptions).
+ Tap(func() {
+ input.ExpectMenu().Title(Equals("Bisect")).Select(MatchesRegexp(`mark .* as good`)).Confirm()
+
+ input.ExpectAlert().Title(Equals("Bisect complete")).Content(MatchesRegexp("(?s)commit 08.*Do you want to reset")).Confirm()
+
+ input.Views().Information().Content(DoesNotContain("bisecting"))
+ }).
+ // back in master branch which just had the one commit
+ Lines(
+ Contains("only commit on master"),
+ )
},
})