MCPcopy Index your code
hub / github.com/codehamr/codehamr / TestStatusBarShowsSpinnerWhenWaiting

Function TestStatusBarShowsSpinnerWhenWaiting

internal/tui/tui_test.go:1397–1414  ·  view source on GitHub ↗

TestStatusBarShowsSpinnerWhenWaiting verifies the micro-animation text appears in the bottom bar while a request is in flight, and disappears when not.

(t *testing.T)

Source from the content-addressed store, hash-verified

1395 fmt.Fprint(w, "data: [DONE]\n\n")
1396 }, "", "hi").View()
1397 if strings.Contains(view, "pass") {
1398 t.Fatalf("without headers the status bar must not show pass segment: %s", view)
1399 }
1400}
1401
1402// TestViewHandlesZeroWidth reproduces the "shrunk UI" startup flash: before
1403// WindowSizeMsg arrives, View must not panic or emit garbled layout.
1404func TestViewHandlesZeroWidth(t *testing.T) {
1405 cfg, _, _ := config.Bootstrap(t.TempDir())
1406 m := New(cfg, llm.New("http://x", cfg.ActiveProfile().LLM, ""), t.TempDir(), "test")
1407 m.width = 0 // simulate no WindowSizeMsg yet
1408 if got := m.View(); got != "" {
1409 t.Fatalf("zero-width view should be empty, got %q", got)
1410 }
1411 // After a real WindowSizeMsg the full frame should render.
1412 sized, _ := m.Update(tea.WindowSizeMsg{Width: 80, Height: 24})
1413 if sized.(Model).View() == "" {
1414 t.Fatal("sized view should not be empty")
1415 }
1416}
1417

Callers

nothing calls this directly

Calls 2

newTestModelFunction · 0.85
renderStatusBarMethod · 0.80

Tested by

no test coverage detected