TestPopoverRenderRightAligns: each row ends flush with the popover width (== m.width after ANSI stripping). The value starts at column 0 and the description is right-aligned.
(t *testing.T)
| 2887 | om = out.(Model) |
| 2888 | if om.ta.Value() != beforeVal || om.ta.Height() != beforeHeight { |
| 2889 | t.Fatalf("BlurMsg altered state: val=%q h=%d", |
| 2890 | om.ta.Value(), om.ta.Height()) |
| 2891 | } |
| 2892 | if cmd != nil { |
| 2893 | t.Fatal("BlurMsg must not return a Cmd") |
| 2894 | } |
| 2895 | } |
| 2896 | |
| 2897 | // TestEmptyRunesKeyIsDropped: KeyMsg{Type: KeyRunes, Runes: nil} arises when |
| 2898 | // bubbletea's parser chokes on a partial escape sequence. Falling through |
| 2899 | // inserts nothing but triggers recomputeLayout: a stream of them flickers the |
| 2900 | // UI, so drop them at the front door. |
| 2901 | func TestEmptyRunesKeyIsDropped(t *testing.T) { |
| 2902 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 2903 | beforeVal := m.ta.Value() |
| 2904 | out, _ := m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: nil}) |
| 2905 | om := out.(Model) |
| 2906 | if om.ta.Value() != beforeVal { |
| 2907 | t.Fatalf("empty-runes key leaked into textarea: %q", om.ta.Value()) |
| 2908 | } |
nothing calls this directly
no test coverage detected