@@ -55,48 +55,48 @@ func TestWhitespaceStyle(t *testing.T) {
55
55
})
56
56
}
57
57
58
- // Test with a disabled item and custom style
59
- for _ , tc := range []struct {
60
- name string
61
- setupFn func ()
62
- bindings [][]key.Binding
63
- }{
64
- {
65
- name : "disabled_item" ,
66
- setupFn : func () {
67
- m .Width = 40
68
- },
69
- bindings : [][]key.Binding {{
70
- key .NewBinding (k , key .WithHelp ("enter" , "continue" )),
71
- key .NewBinding (k , key .WithHelp ("ctrl+c" , "quit" ), key .WithDisabled ()),
72
- }},
73
- },
74
- {
75
- name : "custom_style" ,
76
- setupFn : func () {
77
- m .Width = 40
78
- customBg := lipgloss .Color ("#00FF00" )
79
- m .Styles .FullWhitespace = m .Styles .FullWhitespace .Background (customBg )
80
- m .Styles .ShortWhitespace = m .Styles .ShortWhitespace .Background (customBg )
81
- },
82
- bindings : kb ,
83
- },
84
- } {
85
- t .Run (tc .name + "_full" , func (t * testing.T ) {
86
- tc .setupFn ()
87
- s := m .FullHelpView (tc .bindings )
88
- golden .RequireEqual (t , []byte (s ))
89
- })
58
+ // Test with a disabled item and custom style
59
+ for _ , tc := range []struct {
60
+ name string
61
+ setupFn func ()
62
+ bindings [][]key.Binding
63
+ }{
64
+ {
65
+ name : "disabled_item" ,
66
+ setupFn : func () {
67
+ m .Width = 40
68
+ },
69
+ bindings : [][]key.Binding {{
70
+ key .NewBinding (k , key .WithHelp ("enter" , "continue" )),
71
+ key .NewBinding (k , key .WithHelp ("ctrl+c" , "quit" ), key .WithDisabled ()),
72
+ }},
73
+ },
74
+ {
75
+ name : "custom_style" ,
76
+ setupFn : func () {
77
+ m .Width = 40
78
+ customBg := lipgloss .Color ("#00FF00" )
79
+ m .Styles .FullWhitespace = m .Styles .FullWhitespace .Background (customBg )
80
+ m .Styles .ShortWhitespace = m .Styles .ShortWhitespace .Background (customBg )
81
+ },
82
+ bindings : kb ,
83
+ },
84
+ } {
85
+ t .Run (tc .name + "_full" , func (t * testing.T ) {
86
+ tc .setupFn ()
87
+ s := m .FullHelpView (tc .bindings )
88
+ golden .RequireEqual (t , []byte (s ))
89
+ })
90
90
91
- t .Run (tc .name + "_short" , func (t * testing.T ) {
92
- tc .setupFn ()
93
- // Flatten the bindings for short help
94
- var shortBindings []key.Binding
95
- for _ , group := range tc .bindings {
96
- shortBindings = append (shortBindings , group ... )
97
- }
98
- s := m .ShortHelpView (shortBindings )
99
- golden .RequireEqual (t , []byte (s ))
100
- })
101
- }
91
+ t .Run (tc .name + "_short" , func (t * testing.T ) {
92
+ tc .setupFn ()
93
+ // Flatten the bindings for short help
94
+ var shortBindings []key.Binding
95
+ for _ , group := range tc .bindings {
96
+ shortBindings = append (shortBindings , group ... )
97
+ }
98
+ s := m .ShortHelpView (shortBindings )
99
+ golden .RequireEqual (t , []byte (s ))
100
+ })
101
+ }
102
102
}
0 commit comments