mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-11-27 22:38:09 +02:00
Add enum validation for Git.Log.Order and Git.Log.ShowGraph
This commit is contained in:
@@ -82,6 +82,35 @@ func TestUserConfigValidate_enums(t *testing.T) {
|
||||
{value: "invalid_value", valid: false},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Git.Log.Order",
|
||||
setup: func(config *UserConfig, value string) {
|
||||
config.Git.Log.Order = value
|
||||
},
|
||||
testCases: []testCase{
|
||||
{value: "date-order", valid: true},
|
||||
{value: "author-date-order", valid: true},
|
||||
{value: "topo-order", valid: true},
|
||||
{value: "default", valid: true},
|
||||
|
||||
{value: "", valid: false},
|
||||
{value: "invalid_value", valid: false},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Git.Log.ShowGraph",
|
||||
setup: func(config *UserConfig, value string) {
|
||||
config.Git.Log.ShowGraph = value
|
||||
},
|
||||
testCases: []testCase{
|
||||
{value: "always", valid: true},
|
||||
{value: "never", valid: true},
|
||||
{value: "when-maximised", valid: true},
|
||||
|
||||
{value: "", valid: false},
|
||||
{value: "invalid_value", valid: false},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Keybindings",
|
||||
setup: func(config *UserConfig, value string) {
|
||||
|
||||
Reference in New Issue
Block a user