mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-28 16:02:01 +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:
41
pkg/integration/tests/shell_commands/delete_from_history.go
Normal file
41
pkg/integration/tests/shell_commands/delete_from_history.go
Normal file
@ -0,0 +1,41 @@
|
||||
package shell_commands
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var DeleteFromHistory = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Delete an entry from the custom commands history",
|
||||
ExtraCmdArgs: []string{},
|
||||
Skip: false,
|
||||
SetupRepo: func(shell *Shell) {},
|
||||
SetupConfig: func(cfg *config.AppConfig) {},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
createCustomCommand := func(command string) {
|
||||
t.GlobalPress(keys.Universal.ExecuteCustomCommand)
|
||||
t.ExpectPopup().Prompt().
|
||||
Title(Equals("Custom command:")).
|
||||
Type(command).
|
||||
Confirm()
|
||||
}
|
||||
|
||||
createCustomCommand("echo 1")
|
||||
createCustomCommand("echo 2")
|
||||
createCustomCommand("echo 3")
|
||||
|
||||
t.GlobalPress(keys.Universal.ExecuteCustomCommand)
|
||||
t.ExpectPopup().Prompt().
|
||||
Title(Equals("Custom command:")).
|
||||
SuggestionLines(
|
||||
Contains("3"),
|
||||
Contains("2"),
|
||||
Contains("1"),
|
||||
).
|
||||
DeleteSuggestion(Contains("2")).
|
||||
SuggestionLines(
|
||||
Contains("3"),
|
||||
Contains("1"),
|
||||
)
|
||||
},
|
||||
})
|
Reference in New Issue
Block a user