1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-26 05:37:18 +02:00

33 lines
903 B
Go
Raw Normal View History

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:35:36 +11:00
Run: func(shell *Shell, t *TestDriver, keys config.KeybindingConfig) {
t.Model().StashCount(0)
t.Model().WorkingTreeFileCount(1)
2022-09-15 23:11:27 -02:30
2022-12-27 21:35:36 +11:00
t.Views().Files().
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-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 21:35:36 +11:00
t.Model().StashCount(1)
t.Model().WorkingTreeFileCount(0)
2022-09-15 23:11:27 -02:30
},
})