1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-14 11:23:09 +02:00
lazygit/pkg/integration/tests/custom_commands/omit_from_history.go
2023-04-13 19:17:08 +02:00

39 lines
1.1 KiB
Go

package custom_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: "",
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()
},
})