mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-07 22:02:56 +03:00
Add new integration tests folder "shell_commands"
The folder custom_commands contained tests for both custom commands (the ones you configure in config.yml) and shell commands (the ones you execute at the ":" prompt). I always found this confusing, so separate these into two different folders.
This commit is contained in:
38
pkg/integration/tests/shell_commands/omit_from_history.go
Normal file
38
pkg/integration/tests/shell_commands/omit_from_history.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package shell_commands
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var OmitFromHistory = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Omitting a runtime custom command from history if it begins with space",
|
||||
ExtraCmdArgs: []string{},
|
||||
Skip: false,
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.EmptyCommit("blah")
|
||||
},
|
||||
SetupConfig: func(cfg *config.AppConfig) {},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.GlobalPress(keys.Universal.ExecuteCustomCommand)
|
||||
t.ExpectPopup().Prompt().
|
||||
Title(Equals("Custom command:")).
|
||||
Type("echo aubergine").
|
||||
Confirm()
|
||||
|
||||
t.GlobalPress(keys.Universal.ExecuteCustomCommand)
|
||||
t.ExpectPopup().Prompt().
|
||||
Title(Equals("Custom command:")).
|
||||
SuggestionLines(Contains("aubergine")).
|
||||
SuggestionLines(DoesNotContain("tangerine")).
|
||||
Type(" echo tangerine").
|
||||
Confirm()
|
||||
|
||||
t.GlobalPress(keys.Universal.ExecuteCustomCommand)
|
||||
t.ExpectPopup().Prompt().
|
||||
Title(Equals("Custom command:")).
|
||||
SuggestionLines(Contains("aubergine")).
|
||||
SuggestionLines(DoesNotContain("tangerine")).
|
||||
Cancel()
|
||||
},
|
||||
})
|
Reference in New Issue
Block a user