1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-03-03 15:02:52 +02:00
2022-12-26 10:42:19 +11:00

37 lines
795 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(
shell *Shell,
input *Input,
assert *Assert,
keys config.KeybindingConfig,
) {
assert.WorkingTreeFileCount(0)
input.Press("a")
assert.WorkingTreeFileCount(1)
assert.CurrentLine(Contains("myfile"))
},
})