mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-12-12 11:15:00 +02:00
34 lines
911 B
Go
34 lines
911 B
Go
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"))
|
|
},
|
|
})
|