MCPcopy Create free account
hub / github.com/github/gh-aw / TestStylesRenderNonEmpty

Function TestStylesRenderNonEmpty

pkg/styles/theme_test.go:144–189  ·  view source on GitHub ↗

TestStylesRenderNonEmpty verifies that styles can render text

(t *testing.T)

Source from the content-addressed store, hash-verified

142
143// TestStylesRenderNonEmpty verifies that styles can render text
144func TestStylesRenderNonEmpty(t *testing.T) {
145 testText := "Hello World"
146
147 tests := []struct {
148 name string
149 style lipgloss.Style
150 }{
151 {"Error", Error},
152 {"Warning", Warning},
153 {"Success", Success},
154 {"Info", Info},
155 {"FilePath", FilePath},
156 {"LineNumber", LineNumber},
157 {"ContextLine", ContextLine},
158 {"Highlight", Highlight},
159 {"Location", Location},
160 {"Command", Command},
161 {"Progress", Progress},
162 {"Prompt", Prompt},
163 {"Count", Count},
164 {"Verbose", Verbose},
165 {"ListHeader", ListHeader},
166 {"ListItem", ListItem},
167 {"TableHeader", TableHeader},
168 {"TableCell", TableCell},
169 {"TableTotal", TableTotal},
170 {"TableTitle", TableTitle},
171 {"TableBorder", TableBorder},
172 {"ServerName", ServerName},
173 {"ServerType", ServerType},
174 {"ErrorBox", ErrorBox},
175 {"Header", Header},
176 }
177
178 for _, tt := range tests {
179 t.Run(tt.name, func(t *testing.T) {
180 result := tt.style.Render(testText)
181 // The rendered result should contain the original text
182 // (styles add ANSI codes but shouldn't remove the text)
183 if len(result) < len(testText) {
184 t.Errorf("Style %s: rendered length %d is less than input length %d",
185 tt.name, len(result), len(testText))
186 }
187 })
188 }
189}
190
191// TestDarkColorsAreOriginalDracula verifies that dark variants match the original Dracula theme colors
192func TestDarkColorsAreOriginalDracula(t *testing.T) {

Callers

nothing calls this directly

Calls 3

RenderMethod · 0.65
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected