TestBackendLabelReflectsConnectedState asserts the backend label renders differently when connected vs not: the user's at-a-glance "are we talking to a server?" signal. Disconnected appends a `!` marker so the distinction survives on colour-stripped terminals.
(t *testing.T)
| 1418 | |
| 1419 | // TestStatusBarShowsSpinnerWhenWaiting verifies the micro-animation text |
| 1420 | // appears in the bottom bar while a request is in flight, and disappears |
| 1421 | // when not. |
| 1422 | func TestStatusBarShowsSpinnerWhenWaiting(t *testing.T) { |
| 1423 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 1424 | if strings.Contains(m.renderStatusBar(), "thinking") { |
| 1425 | t.Fatal("idle status bar must not show thinking indicator") |
| 1426 | } |
| 1427 | m.phase = phaseThinking |
| 1428 | if !strings.Contains(m.renderStatusBar(), "thinking") { |
| 1429 | t.Fatalf("thinking status bar must show thinking indicator: %q", m.renderStatusBar()) |
| 1430 | } |
| 1431 | m.phase = phaseStreaming |
| 1432 | if !strings.Contains(m.renderStatusBar(), "generating") { |
| 1433 | t.Fatalf("streaming status bar must show generating indicator: %q", m.renderStatusBar()) |
| 1434 | } |
| 1435 | m.phase = phaseRunning |
| 1436 | if !strings.Contains(m.renderStatusBar(), "running") { |
nothing calls this directly
no test coverage detected