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

Function TestStatusBarLiveTimerAndFrozenSummary

internal/tui/tui_test.go:2288–2313  ·  view source on GitHub ↗

TestStatusBarLiveTimerAndFrozenSummary: during an active turn the bar shows the phase label plus a ticking wall-clock; at idle after a clean finish it shows the frozen ✓, the wall-clock duration, and the avg rate that divides into it (5000 tok ÷ 100s = 50 tok/s).

(t *testing.T)

Source from the content-addressed store, hash-verified

2286 {Role: chmctx.RoleAssistant, Content: coderLeak},
2287 {Role: chmctx.RoleUser, Content: "go on"},
2288 {Role: chmctx.RoleAssistant, Content: clean},
2289 }
2290 if w := toolCallLeakWarning(hist); w != "" {
2291 t.Fatalf("only the newest assistant message should be checked, got %q", w)
2292 }
2293}
2294
2295// TestStatusBarShowsSessionTokens: once the counter is non-zero it appears
2296// in the status bar; at zero the bar stays quiet.
2297func TestStatusBarShowsSessionTokens(t *testing.T) {
2298 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
2299 if strings.Contains(m.renderStatusBar(), "tok") {
2300 t.Fatalf("fresh session (0 tok) should not render counter: %q", m.renderStatusBar())
2301 }
2302 m.sessionTokens = 1234
2303 bar := m.renderStatusBar()
2304 if !strings.Contains(bar, "1.2k tok") {
2305 t.Fatalf("status bar should show compact session counter: %q", bar)
2306 }
2307}
2308
2309// TestStatusBarLiveTimerAndFrozenSummary: during an active turn the bar shows
2310// the phase label plus a ticking wall-clock; at idle after a clean finish it
2311// shows the frozen ✓, the wall-clock duration, and the avg rate that divides
2312// into it (5000 tok ÷ 100s = 50 tok/s).
2313func TestStatusBarLiveTimerAndFrozenSummary(t *testing.T) {
2314 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
2315
2316 m.phase = phaseStreaming

Callers

nothing calls this directly

Calls 3

newTestModelFunction · 0.85
stripANSIFunction · 0.85
renderStatusBarMethod · 0.80

Tested by

no test coverage detected