TestStatusBarShowsSpinnerWhenWaiting verifies the micro-animation text appears in the bottom bar while a request is in flight, and disappears when not.
(t *testing.T)
| 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. |
| 1404 | func 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 |
nothing calls this directly
no test coverage detected