TestHistoryPushesOnSubmit: successful submit appends to promptHistory and resets the walker index to -1.
(t *testing.T)
| 540 | func TestHistoryPushesOnSubmit(t *testing.T) { |
| 541 | m := newTestModel(t, func(w http.ResponseWriter, _ *http.Request) { |
| 542 | fmt.Fprint(w, "data: "+`{"type":"response.output_text.delta","delta":"ok"}`+"\n\n") |
| 543 | fmt.Fprint(w, "data: {\"type\":\"response.completed\",\"response\":{}}\n\n") |
| 544 | }) |
| 545 | m.histIdx = 2 // simulate "was navigating history" |
| 546 | mm, _ := m.submit("hello", "hello", promptEntry{display: "hello"}) |
| 547 | final := mm.(Model) |
| 548 | if len(final.promptHistory) != 1 || final.promptHistory[0].display != "hello" { |
| 549 | t.Fatalf("promptHistory wrong: %+v", final.promptHistory) |
| 550 | } |
| 551 | if final.histIdx != -1 { |
| 552 | t.Fatalf("histIdx should reset to -1 after submit, got %d", final.histIdx) |
| 553 | } |
| 554 | } |
| 555 | |
| 556 | // TestBackendLabelShowsActiveProfile: the label echoes the currently active |
| 557 | // profile name. Default Bootstrap ships one profile called "local". No |
| 558 | // brackets: the label is just the name (bold). |
| 559 | func TestBackendLabelShowsActiveProfile(t *testing.T) { |
nothing calls this directly
no test coverage detected