summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/stash
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-12-24 17:48:57 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-12-24 19:15:59 +1100
commitb623ecf898e1ac35b0a6093978203a7b5c13c42e (patch)
tree670c2ecdc78e84fbb6dc9988195a6f3a991df217 /pkg/integration/tests/stash
parentaedfce28459bc59865b516dba2ee480a5d0972f1 (diff)
add helper functions for popups in tests
Diffstat (limited to 'pkg/integration/tests/stash')
-rw-r--r--pkg/integration/tests/stash/rename.go7
-rw-r--r--pkg/integration/tests/stash/stash.go11
-rw-r--r--pkg/integration/tests/stash/stash_including_untracked_files.go11
3 files changed, 10 insertions, 19 deletions
diff --git a/pkg/integration/tests/stash/rename.go b/pkg/integration/tests/stash/rename.go
index 3589c5a76..c325822e6 100644
--- a/pkg/integration/tests/stash/rename.go
+++ b/pkg/integration/tests/stash/rename.go
@@ -25,12 +25,9 @@ var Rename = NewIntegrationTest(NewIntegrationTestArgs{
assert.SelectedLine(Equals("On master: bar"))
input.NextItem()
assert.SelectedLine(Equals("On master: foo"))
- input.PressKeys(keys.Stash.RenameStash)
- assert.InPrompt()
- assert.CurrentViewTitle(Equals("Rename stash: stash@{1}"))
+ input.Press(keys.Stash.RenameStash)
- input.Type(" baz")
- input.Confirm()
+ input.Prompt(Equals("Rename stash: stash@{1}"), " baz")
assert.SelectedLine(Equals("On master: foo baz"))
},
diff --git a/pkg/integration/tests/stash/stash.go b/pkg/integration/tests/stash/stash.go
index 766469a70..23ff7e99d 100644
--- a/pkg/integration/tests/stash/stash.go
+++ b/pkg/integration/tests/stash/stash.go
@@ -19,15 +19,12 @@ var Stash = NewIntegrationTest(NewIntegrationTestArgs{
assert.StashCount(0)
assert.WorkingTreeFileCount(1)
- input.PressKeys(keys.Files.ViewStashOptions)
- assert.InMenu()
+ input.Press(keys.Files.ViewStashOptions)
- input.PressKeys("a")
- assert.InPrompt()
- assert.CurrentViewTitle(Equals("Stash changes"))
+ input.Menu(Equals("Stash options"), MatchesRegexp("stash all changes$"))
+
+ input.Prompt(Equals("Stash changes"), "my stashed file")
- input.Type("my stashed file")
- input.Confirm()
assert.StashCount(1)
assert.WorkingTreeFileCount(0)
},
diff --git a/pkg/integration/tests/stash/stash_including_untracked_files.go b/pkg/integration/tests/stash/stash_including_untracked_files.go
index 998910f40..d193600df 100644
--- a/pkg/integration/tests/stash/stash_including_untracked_files.go
+++ b/pkg/integration/tests/stash/stash_including_untracked_files.go
@@ -20,15 +20,12 @@ var StashIncludingUntrackedFiles = NewIntegrationTest(NewIntegrationTestArgs{
assert.StashCount(0)
assert.WorkingTreeFileCount(2)
- input.PressKeys(keys.Files.ViewStashOptions)
- assert.InMenu()
+ input.Press(keys.Files.ViewStashOptions)
- input.PressKeys("U")
- assert.InPrompt()
- assert.CurrentViewTitle(Equals("Stash changes"))
+ input.Menu(Equals("Stash options"), Contains("stash all changes including untracked files"))
+
+ input.Prompt(Equals("Stash changes"), "my stashed file")
- input.Type("my stashed file")
- input.Confirm()
assert.StashCount(1)
assert.WorkingTreeFileCount(0)
},