2022-09-15 23:11:27 -02:30
|
|
|
package stash
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
|
|
)
|
|
|
|
|
|
|
|
var Stash = NewIntegrationTest(NewIntegrationTestArgs{
|
|
|
|
Description: "Stashing files",
|
|
|
|
ExtraCmdArgs: "",
|
|
|
|
Skip: false,
|
|
|
|
SetupConfig: func(config *config.AppConfig) {},
|
|
|
|
SetupRepo: func(shell *Shell) {
|
|
|
|
shell.EmptyCommit("initial commit")
|
|
|
|
shell.CreateFile("file", "content")
|
|
|
|
shell.GitAddAll()
|
|
|
|
},
|
2022-12-27 21:47:37 +11:00
|
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
2022-12-27 22:52:20 +11:00
|
|
|
t.Views().Stash().
|
|
|
|
IsEmpty()
|
2022-09-15 23:11:27 -02:30
|
|
|
|
2022-12-27 21:35:36 +11:00
|
|
|
t.Views().Files().
|
2022-12-27 22:52:20 +11:00
|
|
|
Lines(
|
|
|
|
Contains("file"),
|
|
|
|
).
|
2022-12-27 16:27:36 +11:00
|
|
|
Press(keys.Files.ViewStashOptions)
|
2022-10-06 22:42:49 -02:30
|
|
|
|
2022-12-27 21:35:36 +11:00
|
|
|
t.ExpectMenu().Title(Equals("Stash options")).Select(MatchesRegexp("stash all changes$")).Confirm()
|
2022-12-24 17:48:57 +11:00
|
|
|
|
2022-12-27 21:35:36 +11:00
|
|
|
t.ExpectPrompt().Title(Equals("Stash changes")).Type("my stashed file").Confirm()
|
2022-09-15 23:11:27 -02:30
|
|
|
|
2022-12-27 22:52:20 +11:00
|
|
|
t.Views().Stash().
|
|
|
|
Lines(
|
|
|
|
Contains("my stashed file"),
|
|
|
|
)
|
|
|
|
|
|
|
|
t.Views().Files().
|
|
|
|
IsEmpty()
|
2022-09-15 23:11:27 -02:30
|
|
|
},
|
|
|
|
})
|