runTurn wires a model against handler, submits `text`, drains the command chain, and returns the Model. token, when non-empty, is installed on both the active profile and the live llm.Client so cloud auth headers travel as in production.
(t *testing.T, handler http.HandlerFunc, token, text string)
| 1184 | func TestViewHandlesZeroWidth(t *testing.T) { |
| 1185 | cfg, _, _ := config.Bootstrap(t.TempDir()) |
| 1186 | m := New(cfg, llm.New("http://x", cfg.ActiveProfile().LLM, ""), t.TempDir(), "test") |
| 1187 | m.width = 0 // simulate no WindowSizeMsg yet |
| 1188 | if got := m.View(); got != "" { |
| 1189 | t.Fatalf("zero-width view should be empty, got %q", got) |
| 1190 | } |
| 1191 | // After a real WindowSizeMsg the full frame should render. |
| 1192 | sized, _ := m.Update(tea.WindowSizeMsg{Width: 80, Height: 24}) |
| 1193 | if sized.(Model).View() == "" { |
| 1194 | t.Fatal("sized view should not be empty") |
| 1195 | } |
| 1196 | } |
| 1197 | |
| 1198 | // TestStatusBarShowsSpinnerWhenWaiting verifies the micro animation text |
| 1199 | // appears in the bottom bar while a request is in flight, and disappears |
no test coverage detected