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)
| 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. |
| 296 | func 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 |
nothing calls this directly
no test coverage detected