summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/branch/delete.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-12-27 16:27:36 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-12-27 21:26:18 +1100
commitb166b8f776e45c77a94b6e919f3b9460ff3c2e06 (patch)
tree17459acf768779d92bae318fa631b2cc43aeb472 /pkg/integration/tests/branch/delete.go
parentc5c9f5bb941342766f86626ad13d30e5ce01980e (diff)
combine assert and input structs, clean up interface
Diffstat (limited to 'pkg/integration/tests/branch/delete.go')
-rw-r--r--pkg/integration/tests/branch/delete.go29
1 files changed, 15 insertions, 14 deletions
diff --git a/pkg/integration/tests/branch/delete.go b/pkg/integration/tests/branch/delete.go
index 08b4e8f62..eba3a016f 100644
--- a/pkg/integration/tests/branch/delete.go
+++ b/pkg/integration/tests/branch/delete.go
@@ -16,27 +16,28 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{
NewBranch("branch-one").
NewBranch("branch-two")
},
- Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
- input.SwitchToBranchesView()
-
- assert.Views().Current().Lines(
- MatchesRegexp(`\*.*branch-two`),
- MatchesRegexp(`branch-one`),
- MatchesRegexp(`master`),
- )
+ Run: func(shell *Shell, input *Input, keys config.KeybindingConfig) {
+ input.Views().Branches().
+ Focus().
+ Lines(
+ MatchesRegexp(`\*.*branch-two`).IsSelected(),
+ MatchesRegexp(`branch-one`),
+ MatchesRegexp(`master`),
+ ).
+ Press(keys.Universal.Remove)
- input.Press(keys.Universal.Remove)
- input.Alert().Title(Equals("Error")).Content(Contains("You cannot delete the checked out branch!")).Confirm()
+ input.ExpectAlert().Title(Equals("Error")).Content(Contains("You cannot delete the checked out branch!")).Confirm()
- input.NextItem()
+ input.Views().Branches().
+ SelectNextItem().
+ Press(keys.Universal.Remove)
- input.Press(keys.Universal.Remove)
- input.Confirmation().
+ input.ExpectConfirmation().
Title(Equals("Delete Branch")).
Content(Contains("Are you sure you want to delete the branch 'branch-one'?")).
Confirm()
- assert.Views().Current().Name("localBranches").
+ input.Views().Branches().IsFocused().
Lines(
MatchesRegexp(`\*.*branch-two`),
MatchesRegexp(`master`).IsSelected(),