2022-10-15 04:57:19 +02:00
|
|
|
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").
|
2022-10-16 09:26:01 +02:00
|
|
|
CreateFileAndAdd("file-1", "change to stash1").
|
|
|
|
StashWithMessage("foo").
|
|
|
|
CreateFileAndAdd("file-2", "change to stash2").
|
2022-10-15 04:57:19 +02:00
|
|
|
StashWithMessage("bar")
|
|
|
|
},
|
2022-12-27 12:35:36 +02:00
|
|
|
Run: func(shell *Shell, t *TestDriver, keys config.KeybindingConfig) {
|
|
|
|
t.Views().Stash().
|
2022-12-27 07:27:36 +02:00
|
|
|
Focus().
|
|
|
|
Lines(
|
|
|
|
Equals("On master: bar"),
|
|
|
|
Equals("On master: foo"),
|
|
|
|
).
|
|
|
|
SelectNextItem().
|
2022-12-27 12:25:11 +02:00
|
|
|
Press(keys.Stash.RenameStash).
|
|
|
|
Tap(func() {
|
2022-12-27 12:35:36 +02:00
|
|
|
t.ExpectPrompt().Title(Equals("Rename stash: stash@{1}")).Type(" baz").Confirm()
|
2022-12-27 12:25:11 +02:00
|
|
|
}).
|
|
|
|
SelectedLine(Equals("On master: foo baz"))
|
2022-10-15 04:57:19 +02:00
|
|
|
},
|
|
|
|
})
|