1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-24 05:36:19 +02:00

39 lines
909 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{
2023-02-20 21:52:27 +11:00
Description: "Stashing files directly (not going through the stash menu)",
ExtraCmdArgs: []string{},
2022-09-15 23:11:27 -02:30
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"),
).
2023-02-20 21:52:27 +11:00
Press(keys.Files.StashAllChanges)
2022-12-28 11:00:22 +11:00
t.ExpectPopup().Prompt().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(
2023-12-20 20:51:39 +01:00
MatchesRegexp(`\ds .* my stashed file`),
2022-12-27 22:52:20 +11:00
)
t.Views().Files().
IsEmpty()
2022-09-15 23:11:27 -02:30
},
})