MCPcopy Create free account
hub / github.com/codehamr/codehamr / runTurn

Function runTurn

internal/tui/tui_test.go:1186–1196  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1184func 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

Calls 4

newTestModelFunction · 0.85
drainFunction · 0.85
ActiveProfileMethod · 0.80
submitMethod · 0.80

Tested by

no test coverage detected