MCPcopy Create free account
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
293// TestQueuedPromptRendersInView: while something is queued the prompt area shows a
294// labeled box with the echo text, so the user can see what will auto-submit;
295// nothing renders when the slot is empty.
296func TestQueuedPromptRendersInView(t *testing.T) {
297 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
298 m.phase = phaseThinking
299
300 m.queued = &queuedPrompt{send: "run the tests", echo: "run the tests"}
301 view := stripANSI(m.View())
302 if !strings.Contains(view, "run the tests") {
303 t.Fatalf("View must show the queued text:\n%s", view)
304 }
305 if !strings.Contains(strings.ToLower(view), "queued") {
306 t.Fatalf("View must label the queued region:\n%s", view)
307 }
308
309 m.queued = nil
310 if v := stripANSI(m.View()); strings.Contains(strings.ToLower(v), "queued") {
311 t.Fatalf("an empty slot must render no queued box:\n%s", v)
312 }
313}
314

Callers

nothing calls this directly

Calls 3

newTestModelFunction · 0.85
stripANSIFunction · 0.85
ViewMethod · 0.45

Tested by

no test coverage detected