Skip to content

Commit

Permalink
start writing test
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Kappes committed Feb 2, 2024
1 parent fd22a00 commit dadfcbd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions pkg/integration/tests/custom_commands/custom_shell.go
@@ -0,0 +1,28 @@
package custom_commands

import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)

var CustomShell = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Confirms a popup appears on first opening Lazygit",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.OS.Shell = "sh"
config.UserConfig.OS.ShellArg = "-c"
},
SetupRepo: func(shell *Shell) {},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Files().
IsEmpty().
IsFocused().
Press(keys.Universal.ExecuteCustomCommand)

t.ExpectPopup().Prompt().
Title(Equals("Custom command:")).
Type("echo hello world").
Confirm()
},
})
1 change: 1 addition & 0 deletions pkg/integration/tests/test_list.go
Expand Up @@ -97,6 +97,7 @@ var tests = []*components.IntegrationTest{
custom_commands.BasicCmdFromConfig,
custom_commands.CheckForConflicts,
custom_commands.ComplexCmdAtRuntime,
custom_commands.CustomShell,
custom_commands.FormPrompts,
custom_commands.MenuFromCommand,
custom_commands.MenuFromCommandsOutput,
Expand Down

0 comments on commit dadfcbd

Please sign in to comment.