mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-28 16:02:01 +03:00
Add missing validation tests
This commit is contained in:
@ -30,6 +30,32 @@ func TestUserConfigValidate_enums(t *testing.T) {
|
|||||||
{value: "invalid_value", valid: false},
|
{value: "invalid_value", valid: false},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Gui.ShowDivergenceFromBaseBranch",
|
||||||
|
setup: func(config *UserConfig, value string) {
|
||||||
|
config.Gui.ShowDivergenceFromBaseBranch = value
|
||||||
|
},
|
||||||
|
testCases: []testCase{
|
||||||
|
{value: "none", valid: true},
|
||||||
|
{value: "onlyArrow", valid: true},
|
||||||
|
{value: "arrowAndNumber", valid: true},
|
||||||
|
{value: "", valid: false},
|
||||||
|
{value: "invalid_value", valid: false},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Git.AutoForwardBranches",
|
||||||
|
setup: func(config *UserConfig, value string) {
|
||||||
|
config.Git.AutoForwardBranches = value
|
||||||
|
},
|
||||||
|
testCases: []testCase{
|
||||||
|
{value: "none", valid: true},
|
||||||
|
{value: "onlyMainBranches", valid: true},
|
||||||
|
{value: "allBranches", valid: true},
|
||||||
|
{value: "", valid: false},
|
||||||
|
{value: "invalid_value", valid: false},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "Keybindings",
|
name: "Keybindings",
|
||||||
setup: func(config *UserConfig, value string) {
|
setup: func(config *UserConfig, value string) {
|
||||||
|
Reference in New Issue
Block a user