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()
|
|
|
|
},
|
|
|
|
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
|
2022-12-27 15:22:31 +11:00
|
|
|
assert.Model().StashCount(0)
|
|
|
|
assert.Model().WorkingTreeFileCount(1)
|
2022-09-15 23:11:27 -02:30
|
|
|
|
2022-12-24 17:48:57 +11:00
|
|
|
input.Press(keys.Files.ViewStashOptions)
|
2022-10-06 22:42:49 -02:30
|
|
|
|
2022-12-27 11:34:41 +11:00
|
|
|
input.Menu().Title(Equals("Stash options")).Select(MatchesRegexp("stash all changes$")).Confirm()
|
2022-12-24 17:48:57 +11:00
|
|
|
|
2022-12-27 11:21:44 +11:00
|
|
|
input.Prompt().Title(Equals("Stash changes")).Type("my stashed file").Confirm()
|
2022-09-15 23:11:27 -02:30
|
|
|
|
2022-12-27 15:22:31 +11:00
|
|
|
assert.Model().StashCount(1)
|
|
|
|
assert.Model().WorkingTreeFileCount(0)
|
2022-09-15 23:11:27 -02:30
|
|
|
},
|
|
|
|
})
|