mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-12-12 11:15:00 +02:00
34 lines
732 B
Go
34 lines
732 B
Go
package custom_commands
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
)
|
|
|
|
var Basic = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "Using a custom command to create a new file",
|
|
ExtraCmdArgs: "",
|
|
Skip: false,
|
|
SetupRepo: func(shell *Shell) {
|
|
shell.EmptyCommit("blah")
|
|
},
|
|
SetupConfig: func(cfg *config.AppConfig) {
|
|
cfg.UserConfig.CustomCommands = []config.CustomCommand{
|
|
{
|
|
Key: "a",
|
|
Context: "files",
|
|
Command: "touch myfile",
|
|
},
|
|
}
|
|
},
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
|
t.Views().Files().
|
|
IsEmpty().
|
|
IsFocused().
|
|
Press("a").
|
|
Lines(
|
|
Contains("myfile"),
|
|
)
|
|
},
|
|
})
|