summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/stash
diff options
context:
space:
mode:
authorRyooooooga <eial5q265e5@gmail.com>2022-10-15 11:57:19 +0900
committerRyooooooga <eial5q265e5@gmail.com>2022-10-16 09:30:03 +0900
commite78e829e3a8940f5b7b8f0bfc77b3316d19e1e8b (patch)
treed74268b4a7027bc93a6ebc419ec9e945f029d89e /pkg/integration/tests/stash
parenteceb3a5aa6de864f31c52016e6fd497b9b6a1214 (diff)
test: add an integration test for rename stash
Diffstat (limited to 'pkg/integration/tests/stash')
-rw-r--r--pkg/integration/tests/stash/rename.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/pkg/integration/tests/stash/rename.go b/pkg/integration/tests/stash/rename.go
new file mode 100644
index 000000000..97cfae006
--- /dev/null
+++ b/pkg/integration/tests/stash/rename.go
@@ -0,0 +1,33 @@
+package stash
+
+import (
+ "github.com/jesseduffield/lazygit/pkg/config"
+ . "github.com/jesseduffield/lazygit/pkg/integration/components"
+)
+
+var Rename = NewIntegrationTest(NewIntegrationTestArgs{
+ Description: "Try to rename the stash.",
+ ExtraCmdArgs: "",
+ Skip: false,
+ SetupConfig: func(config *config.AppConfig) {},
+ SetupRepo: func(shell *Shell) {
+ shell.
+ EmptyCommit("blah").
+ CreateFileAndAdd("foo", "change to stash").
+ StashWithMessage("bar")
+ },
+ Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
+ input.SwitchToStashWindow()
+ assert.CurrentViewName("stash")
+
+ assert.MatchSelectedLine(Equals("On master: bar"))
+ input.PressKeys(keys.Stash.RenameStash)
+ assert.InPrompt()
+ assert.MatchCurrentViewTitle(Equals("Rename stash: stash@{0}"))
+
+ input.Type(" baz")
+ input.Confirm()
+
+ assert.MatchSelectedLine(Equals("On master: bar baz"))
+ },
+})