TestQueueRestoreKeepsExistingDraft: if the user was typing a new prompt when they Ctrl+C, that draft wins; the queued prompt is dropped rather than clobbering the in-progress text.
(t *testing.T)
| 189 | // they Ctrl+C, that draft wins; the queued prompt is dropped rather than |
| 190 | // clobbering the in-progress text. |
| 191 | func TestQueueRestoreKeepsExistingDraft(t *testing.T) { |
| 192 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 193 | ctx, cancel := context.WithCancel(context.Background()) |
| 194 | m.turnCtx = ctx |
| 195 | m.cancel = cancel |
| 196 | m.phase = phaseThinking |
| 197 | m.queued = &queuedPrompt{send: "queued one", echo: "queued one"} |
| 198 | m.ta.SetValue("a fresh draft") |
| 199 | |
| 200 | out, _ := m.Update(tea.KeyMsg{Type: tea.KeyCtrlC}) |
| 201 | om := out.(Model) |
| 202 | |
| 203 | if om.ta.Value() != "a fresh draft" { |
| 204 | t.Fatalf("an in-progress draft must survive Ctrl+C, got %q", om.ta.Value()) |
| 205 | } |
| 206 | if om.queued != nil { |
| 207 | t.Fatalf("the queued slot must clear on abort, got %+v", om.queued) |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | // TestQueueWaitsForVerifyNudge: a substantial clean finish triggers the verify |
| 212 | // re-grounding nudge, which continues the turn. The queued prompt must NOT fire |
nothing calls this directly
no test coverage detected