Skip to content

Commit a2a300a

Browse files
committed
fix(fmt): format test file
1 parent ee5636d commit a2a300a

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

help/help_whitespace_test.go

+43-43
Original file line numberDiff line numberDiff line change
@@ -55,48 +55,48 @@ func TestWhitespaceStyle(t *testing.T) {
5555
})
5656
}
5757

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+
})
9090

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+
}
102102
}

0 commit comments

Comments
 (0)