TestPopoverShiftTabCyclesUp: Shift+Tab walks the selection backwards, wrapping at the top.
(t *testing.T)
| 359 | // TestPopoverShiftTabCyclesUp: Shift+Tab walks the selection backwards, |
| 360 | // wrapping at the top. |
| 361 | func TestPopoverShiftTabCyclesUp(t *testing.T) { |
| 362 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 363 | mm := typeInto(m, "/") |
| 364 | n := len(mm.suggest) |
| 365 | if !mm.popoverOpen() || n < 2 { |
| 366 | t.Fatalf("precondition: popover open with ≥2 options, got %d", n) |
| 367 | } |
| 368 | mm2, _ := mm.Update(tea.KeyMsg{Type: tea.KeyShiftTab}) |
| 369 | if mm2.(Model).suggestIdx != (mm.suggestIdx-1+n)%n { |
| 370 | t.Fatalf("Shift+Tab should move selection up, got idx=%d", mm2.(Model).suggestIdx) |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | // TestEscFromCommandLevelClosesAndClears: Esc at command-level closes the |
| 375 | // popover AND clears the textarea, so the user returns to a blank prompt. |
nothing calls this directly
no test coverage detected