1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-12 11:15:00 +02:00
lazygit/pkg/integration/tests/stash/rename.go

36 lines
985 B
Go
Raw Normal View History

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("file-1", "change to stash1").
StashWithMessage("foo").
CreateFileAndAdd("file-2", "change to stash2").
StashWithMessage("bar")
},
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
2022-12-26 07:49:54 +02:00
input.SwitchToStashView()
2022-12-27 06:07:11 +02:00
assert.Views().Current().Lines(
2022-12-25 02:38:00 +02:00
Equals("On master: bar"),
Equals("On master: foo"),
)
input.NextItem()
input.Press(keys.Stash.RenameStash)
2022-12-27 02:21:44 +02:00
input.Prompt().Title(Equals("Rename stash: stash@{1}")).Type(" baz").Confirm()
2022-12-27 06:07:11 +02:00
assert.Views().Current().SelectedLine(Equals("On master: foo baz"))
},
})