mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Combine customCommand's subprocess, stream, and showOutput fields into a single output enum
This commit is contained in:
@ -95,6 +95,25 @@ func TestUserConfigValidate_enums(t *testing.T) {
|
||||
{value: "invalid_value", valid: false},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Custom command output",
|
||||
setup: func(config *UserConfig, value string) {
|
||||
config.CustomCommands = []CustomCommand{
|
||||
{
|
||||
Output: value,
|
||||
},
|
||||
}
|
||||
},
|
||||
testCases: []testCase{
|
||||
{value: "", valid: true},
|
||||
{value: "none", valid: true},
|
||||
{value: "terminal", valid: true},
|
||||
{value: "log", valid: true},
|
||||
{value: "logWithPty", valid: true},
|
||||
{value: "popup", valid: true},
|
||||
{value: "invalid_value", valid: false},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Custom command sub menu",
|
||||
setup: func(config *UserConfig, _ string) {
|
||||
@ -132,11 +151,10 @@ func TestUserConfigValidate_enums(t *testing.T) {
|
||||
{
|
||||
name: "Custom command sub menu",
|
||||
setup: func(config *UserConfig, _ string) {
|
||||
falseVal := false
|
||||
config.CustomCommands = []CustomCommand{
|
||||
{
|
||||
Key: "X",
|
||||
Subprocess: &falseVal, // other properties are not allowed for submenus (using subprocess as an example)
|
||||
Key: "X",
|
||||
LoadingText: "loading", // other properties are not allowed for submenus (using loadingText as an example)
|
||||
CommandMenu: []CustomCommand{
|
||||
{Key: "1", Command: "echo 'hello'", Context: "global"},
|
||||
},
|
||||
|
Reference in New Issue
Block a user