TestAltEnterInsertsNewline: Alt+Enter composes a multi-line prompt. The alt-flagged KeyEnter ("alt+enter") matches no textarea binding, so the flag must be stripped before forwarding or the key is a silent no-op and multi-line prompts can only be pasted.
(t *testing.T)
| 1528 | // TestCtrlLClosesPopover: Ctrl+L clears the popover along with the prompt. |
| 1529 | // Left open on stale suggestions, the next Enter would take the has-selection |
| 1530 | // path and insert a ghost command into the freshly emptied prompt. |
| 1531 | func TestCtrlLClosesPopover(t *testing.T) { |
| 1532 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 1533 | o1, _ := m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'/'}}) |
| 1534 | m1 := o1.(Model) |
| 1535 | if !m1.popoverOpen() { |
| 1536 | t.Fatal("precondition: typing '/' opens the command popover") |
| 1537 | } |
| 1538 | |
| 1539 | o2, _ := m1.Update(tea.KeyMsg{Type: tea.KeyCtrlL}) |
| 1540 | m2 := o2.(Model) |
| 1541 | if m2.popoverOpen() { |
| 1542 | t.Fatal("Ctrl+L must close the popover along with the prompt") |
| 1543 | } |
| 1544 | o3, _ := m2.Update(tea.KeyMsg{Type: tea.KeyEnter}) |
nothing calls this directly
no test coverage detected