summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/cherry_pick
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/cherry_pick
parentb166b8f776e45c77a94b6e919f3b9460ff3c2e06 (diff)
add tap function
Diffstat (limited to 'pkg/integration/tests/cherry_pick')
-rw-r--r--pkg/integration/tests/cherry_pick/cherry_pick.go43
-rw-r--r--pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go39
2 files changed, 39 insertions, 43 deletions
diff --git a/pkg/integration/tests/cherry_pick/cherry_pick.go b/pkg/integration/tests/cherry_pick/cherry_pick.go
index 75c060b34..de9e0a645 100644
--- a/pkg/integration/tests/cherry_pick/cherry_pick.go
+++ b/pkg/integration/tests/cherry_pick/cherry_pick.go
@@ -42,11 +42,10 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{
Contains("base"),
).
// copy commits 'four' and 'three'
- Press(keys.Commits.CherryPickCopy)
-
- input.Views().Information().Content(Contains("1 commit copied"))
-
- input.Views().SubCommits().
+ Press(keys.Commits.CherryPickCopy).
+ Tap(func() {
+ input.Views().Information().Content(Contains("1 commit copied"))
+ }).
SelectNextItem().
Press(keys.Commits.CherryPickCopy)
@@ -59,29 +58,27 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{
Contains("one"),
Contains("base"),
).
- Press(keys.Commits.PasteCommits)
-
- input.ExpectAlert().
- Title(Equals("Cherry-Pick")).
- Content(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?")).
- Confirm()
-
- input.Views().Commits().
- IsFocused().
+ Press(keys.Commits.PasteCommits).
+ Tap(func() {
+ input.ExpectAlert().
+ Title(Equals("Cherry-Pick")).
+ Content(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?")).
+ Confirm()
+ }).
Lines(
Contains("four"),
Contains("three"),
Contains("two"),
Contains("one"),
Contains("base"),
- )
-
- // we need to manually exit out of cherrry pick mode
- input.Views().Information().Content(Contains("2 commits copied"))
-
- input.Views().Commits().
- PressEscape()
-
- input.Views().Information().Content(DoesNotContain("commits copied"))
+ ).
+ Tap(func() {
+ // we need to manually exit out of cherry pick mode
+ input.Views().Information().Content(Contains("2 commits copied"))
+ }).
+ PressEscape().
+ Tap(func() {
+ input.Views().Information().Content(DoesNotContain("commits copied"))
+ })
},
})
diff --git a/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go b/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go
index 9b97be5db..9c02cc8d0 100644
--- a/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go
+++ b/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go
@@ -31,11 +31,10 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{
Contains("second-change-branch unrelated change"),
Contains("second change"),
).
- Press(keys.Commits.CherryPickCopy)
-
- input.Views().Information().Content(Contains("1 commit copied"))
-
- input.Views().SubCommits().
+ Press(keys.Commits.CherryPickCopy).
+ Tap(func() {
+ input.Views().Information().Content(Contains("1 commit copied"))
+ }).
SelectNextItem().
Press(keys.Commits.CherryPickCopy)
@@ -80,20 +79,20 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{
Contains("second change"),
Contains("first change"),
).
- SelectNextItem()
-
- // because we picked 'Second change' when resolving the conflict,
- // we now see this commit as having replaced First Change with Second Change,
- // as opposed to replacing 'Original' with 'Second change'
- input.Views().Main().
- Content(Contains("-First Change")).
- Content(Contains("+Second Change"))
-
- input.Views().Information().Content(Contains("2 commits copied"))
-
- input.Views().Commits().
- PressEscape()
-
- input.Views().Information().Content(DoesNotContain("commits copied"))
+ SelectNextItem().
+ Tap(func() {
+ // because we picked 'Second change' when resolving the conflict,
+ // we now see this commit as having replaced First Change with Second Change,
+ // as opposed to replacing 'Original' with 'Second change'
+ input.Views().Main().
+ Content(Contains("-First Change")).
+ Content(Contains("+Second Change"))
+
+ input.Views().Information().Content(Contains("2 commits copied"))
+ }).
+ PressEscape().
+ Tap(func() {
+ input.Views().Information().Content(DoesNotContain("commits copied"))
+ })
},
})