summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/cherry_pick
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-12-27 15:07:11 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-12-27 21:26:18 +1100
commitbe30cbb37509f09c53265aa39d89cac1f6cd65c2 (patch)
treeb4de7229344ed48c6a38201a13c4a0bce49bd8d4 /pkg/integration/tests/cherry_pick
parentb64f55518bc0f986662b54bbaaefecc692555100 (diff)
add view asserter getter struct
Diffstat (limited to 'pkg/integration/tests/cherry_pick')
-rw-r--r--pkg/integration/tests/cherry_pick/cherry_pick.go16
-rw-r--r--pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go26
2 files changed, 21 insertions, 21 deletions
diff --git a/pkg/integration/tests/cherry_pick/cherry_pick.go b/pkg/integration/tests/cherry_pick/cherry_pick.go
index 631685577..f832bfe83 100644
--- a/pkg/integration/tests/cherry_pick/cherry_pick.go
+++ b/pkg/integration/tests/cherry_pick/cherry_pick.go
@@ -26,7 +26,7 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
input.SwitchToBranchesView()
- assert.CurrentView().Lines(
+ assert.Views().Current().Lines(
Contains("first-branch"),
Contains("second-branch"),
Contains("master"),
@@ -36,7 +36,7 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{
input.Enter()
- assert.CurrentView().Name("subCommits").Lines(
+ assert.Views().Current().Name("subCommits").Lines(
Contains("four"),
Contains("three"),
Contains("base"),
@@ -44,14 +44,14 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{
// copy commits 'four' and 'three'
input.Press(keys.Commits.CherryPickCopy)
- assert.View("information").Content(Contains("1 commit copied"))
+ assert.Views().ByName("information").Content(Contains("1 commit copied"))
input.NextItem()
input.Press(keys.Commits.CherryPickCopy)
- assert.View("information").Content(Contains("2 commits copied"))
+ assert.Views().ByName("information").Content(Contains("2 commits copied"))
input.SwitchToCommitsView()
- assert.CurrentView().Lines(
+ assert.Views().Current().Lines(
Contains("two"),
Contains("one"),
Contains("base"),
@@ -63,7 +63,7 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{
Content(Contains("Are you sure you want to cherry-pick the copied commits onto this branch?")).
Confirm()
- assert.CurrentView().Name("commits").Lines(
+ assert.Views().Current().Name("commits").Lines(
Contains("four"),
Contains("three"),
Contains("two"),
@@ -71,8 +71,8 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{
Contains("base"),
)
- assert.View("information").Content(Contains("2 commits copied"))
+ assert.Views().ByName("information").Content(Contains("2 commits copied"))
input.Press(keys.Universal.Return)
- assert.View("information").Content(DoesNotContain("commits copied"))
+ assert.Views().ByName("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 8efb94e5d..b0be4b48e 100644
--- a/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go
+++ b/pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go
@@ -16,7 +16,7 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{
},
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
input.SwitchToBranchesView()
- assert.CurrentView().Lines(
+ assert.Views().Current().Lines(
Contains("first-change-branch"),
Contains("second-change-branch"),
Contains("original-branch"),
@@ -26,21 +26,21 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{
input.Enter()
- assert.CurrentView().Name("subCommits").TopLines(
+ assert.Views().Current().Name("subCommits").TopLines(
Contains("second-change-branch unrelated change"),
Contains("second change"),
)
input.Press(keys.Commits.CherryPickCopy)
- assert.View("information").Content(Contains("1 commit copied"))
+ assert.Views().ByName("information").Content(Contains("1 commit copied"))
input.NextItem()
input.Press(keys.Commits.CherryPickCopy)
- assert.View("information").Content(Contains("2 commits copied"))
+ assert.Views().ByName("information").Content(Contains("2 commits copied"))
input.SwitchToCommitsView()
- assert.CurrentView().TopLines(
+ assert.Views().Current().TopLines(
Contains("first change"),
)
@@ -52,14 +52,14 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{
Content(Contains("Conflicts!")).
Confirm()
- assert.CurrentView().Name("files")
- assert.CurrentView().SelectedLine(Contains("file"))
+ assert.Views().Current().Name("files")
+ assert.Views().Current().SelectedLine(Contains("file"))
// not using Confirm() convenience method because I suspect we might change this
// keybinding to something more bespoke
input.Press(keys.Universal.Confirm)
- assert.CurrentView().Name("mergeConflicts")
+ assert.Views().Current().Name("mergeConflicts")
// picking 'Second change'
input.NextItem()
input.PrimaryAction()
@@ -69,12 +69,12 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{
Content(Contains("all merge conflicts resolved. Continue?")).
Confirm()
- assert.CurrentView().Name("files")
+ assert.Views().Current().Name("files")
assert.WorkingTreeFileCount(0)
input.SwitchToCommitsView()
- assert.CurrentView().TopLines(
+ assert.Views().Current().TopLines(
Contains("second-change-branch unrelated change"),
Contains("second change"),
Contains("first change"),
@@ -83,12 +83,12 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{
// 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'
- assert.MainView().
+ assert.Views().Main().
Content(Contains("-First Change")).
Content(Contains("+Second Change"))
- assert.View("information").Content(Contains("2 commits copied"))
+ assert.Views().ByName("information").Content(Contains("2 commits copied"))
input.Press(keys.Universal.Return)
- assert.View("information").Content(DoesNotContain("commits copied"))
+ assert.Views().ByName("information").Content(DoesNotContain("commits copied"))
},
})