mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-04 23:37:41 +02:00
Add test demonstrating missing validation for custom commands in sub menus
We only validate the commands at top level right now.
This commit is contained in:
parent
7137196788
commit
e295477951
@ -74,6 +74,30 @@ func TestUserConfigValidate_enums(t *testing.T) {
|
|||||||
{value: "invalid_value", valid: false},
|
{value: "invalid_value", valid: false},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Custom command keybinding in sub menu",
|
||||||
|
setup: func(config *UserConfig, value string) {
|
||||||
|
config.CustomCommands = []CustomCommand{
|
||||||
|
{
|
||||||
|
Key: "X",
|
||||||
|
Description: "My Custom Commands",
|
||||||
|
CommandMenu: []CustomCommand{
|
||||||
|
{Key: value, Command: "echo 'hello'", Context: "global"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
testCases: []testCase{
|
||||||
|
{value: "", valid: true},
|
||||||
|
{value: "<disabled>", valid: true},
|
||||||
|
{value: "q", valid: true},
|
||||||
|
{value: "<c-c>", valid: true},
|
||||||
|
/* EXPECTED:
|
||||||
|
{value: "invalid_value", valid: false},
|
||||||
|
ACTUAL */
|
||||||
|
{value: "invalid_value", valid: true},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "Custom command sub menu",
|
name: "Custom command sub menu",
|
||||||
setup: func(config *UserConfig, _ string) {
|
setup: func(config *UserConfig, _ string) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user