2022-10-06 22:53:13 -02:30
|
|
|
package stash
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
|
|
)
|
|
|
|
|
|
|
|
var StashIncludingUntrackedFiles = NewIntegrationTest(NewIntegrationTestArgs{
|
|
|
|
Description: "Stashing all files including untracked ones",
|
|
|
|
ExtraCmdArgs: "",
|
|
|
|
Skip: false,
|
|
|
|
SetupConfig: func(config *config.AppConfig) {},
|
|
|
|
SetupRepo: func(shell *Shell) {
|
|
|
|
shell.EmptyCommit("initial commit")
|
|
|
|
shell.CreateFile("file_1", "content")
|
|
|
|
shell.CreateFile("file_2", "content")
|
|
|
|
shell.GitAdd("file_1")
|
|
|
|
},
|
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-10-06 22:53:13 -02:30
|
|
|
|
2022-12-27 21:35:36 +11:00
|
|
|
t.Views().Files().
|
2022-12-27 22:52:20 +11:00
|
|
|
Lines(
|
|
|
|
Contains("file_1"),
|
|
|
|
Contains("file_2"),
|
|
|
|
).
|
2022-12-27 16:27:36 +11:00
|
|
|
Press(keys.Files.ViewStashOptions)
|
2022-10-06 22:53:13 -02:30
|
|
|
|
2022-12-28 11:00:22 +11:00
|
|
|
t.ExpectPopup().Menu().Title(Equals("Stash options")).Select(Contains("stash all changes including untracked files")).Confirm()
|
2022-12-24 17:48:57 +11:00
|
|
|
|
2022-12-28 11:00:22 +11:00
|
|
|
t.ExpectPopup().Prompt().Title(Equals("Stash changes")).Type("my stashed file").Confirm()
|
2022-10-06 22:53:13 -02:30
|
|
|
|
2022-12-27 22:52:20 +11:00
|
|
|
t.Views().Stash().
|
|
|
|
Lines(
|
|
|
|
Contains("my stashed file"),
|
|
|
|
)
|
|
|
|
|
|
|
|
t.Views().Files().
|
|
|
|
IsEmpty()
|
2022-10-06 22:53:13 -02:30
|
|
|
},
|
|
|
|
})
|