diff options
author | Andrew Hynes <andrew.hynes@colabsoftware.com> | 2022-09-15 23:11:27 -0230 |
---|---|---|
committer | Andrew Hynes <andrew.hynes@colabsoftware.com> | 2022-09-15 23:11:27 -0230 |
commit | db9373662a0f1f1d730c9cef556679a313875af7 (patch) | |
tree | 188bb31706b417eeec72bea7e609bb4ca106b3a8 /pkg/integration/tests | |
parent | e189546acb8f36ee1fc2f7aa23538f768054a400 (diff) |
test: add test for basic stash
Diffstat (limited to 'pkg/integration/tests')
-rw-r--r-- | pkg/integration/tests/stash/stash.go | 27 | ||||
-rw-r--r-- | pkg/integration/tests/tests.go | 2 |
2 files changed, 29 insertions, 0 deletions
diff --git a/pkg/integration/tests/stash/stash.go b/pkg/integration/tests/stash/stash.go new file mode 100644 index 000000000..55095e42d --- /dev/null +++ b/pkg/integration/tests/stash/stash.go @@ -0,0 +1,27 @@ +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) { + assert.StashCount(0) + + input.PressKeys(keys.Files.ViewStashOptions) + input.Confirm() + input.Confirm() + + assert.StashCount(1) + }, +}) diff --git a/pkg/integration/tests/tests.go b/pkg/integration/tests/tests.go index 587ac8e30..fd42f0ed6 100644 --- a/pkg/integration/tests/tests.go +++ b/pkg/integration/tests/tests.go @@ -13,6 +13,7 @@ import ( "github.com/jesseduffield/lazygit/pkg/integration/tests/commit" "github.com/jesseduffield/lazygit/pkg/integration/tests/custom_commands" "github.com/jesseduffield/lazygit/pkg/integration/tests/interactive_rebase" + "github.com/jesseduffield/lazygit/pkg/integration/tests/stash" "github.com/jesseduffield/lazygit/pkg/utils" ) @@ -27,6 +28,7 @@ var tests = []*components.IntegrationTest{ custom_commands.Basic, custom_commands.MultiplePrompts, custom_commands.MenuFromCommand, + stash.Stash, } func GetTests() []*components.IntegrationTest { |