From e78e829e3a8940f5b7b8f0bfc77b3316d19e1e8b Mon Sep 17 00:00:00 2001 From: Ryooooooga Date: Sat, 15 Oct 2022 11:57:19 +0900 Subject: test: add an integration test for rename stash --- pkg/integration/tests/stash/rename.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 pkg/integration/tests/stash/rename.go (limited to 'pkg/integration/tests/stash') 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")) + }, +}) -- cgit v1.2.3