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

Function TestQueuedPromptRendersInView

internal/tui/queue_test.go:294–311  ·  view source on GitHub ↗

TestQueuedPromptRendersInView: while something is queued the prompt area shows a labeled box with the echo text, so the user can see what will auto-submit; nothing renders when the slot is empty.

(t *testing.T)

Source from the content-addressed store, hash-verified

292// labeled box with the echo text, so the user can see what will auto-submit;
293// nothing renders when the slot is empty.
294func TestQueuedPromptRendersInView(t *testing.T) {
295 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
296 m.phase = phaseThinking
297
298 m.queued = &queuedPrompt{send: "run the tests", echo: "run the tests"}
299 view := stripANSI(m.View())
300 if !strings.Contains(view, "run the tests") {
301 t.Fatalf("View must show the queued text:\n%s", view)
302 }
303 if !strings.Contains(strings.ToLower(view), "queued") {
304 t.Fatalf("View must label the queued region:\n%s", view)
305 }
306
307 m.queued = nil
308 if v := stripANSI(m.View()); strings.Contains(strings.ToLower(v), "queued") {
309 t.Fatalf("an empty slot must render no queued box:\n%s", v)
310 }
311}
312
313// TestQueueExpandsChipsOnFire: a chip-bearing paste queued mid-turn keeps its
314// expanded content for the LLM (send) while the box echo stays collapsed, the

Callers

nothing calls this directly

Calls 3

newTestModelFunction · 0.85
stripANSIFunction · 0.85
ViewMethod · 0.45

Tested by

no test coverage detected