1
0
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:
Stefan Haller
2025-07-08 12:22:16 +02:00
parent 562a2aaa6b
commit 3575bb9859
2 changed files with 37 additions and 0 deletions

View File

@@ -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) {