TestSplashEmittedOnFirstSize: the splash prints once into scrollback on the first WindowSizeMsg, then scrolls up as content arrives. We verify the lines reach the outbox (drained via tea.Println by the Update wrapper in production).
(t *testing.T)
| 2799 | continue |
| 2800 | } |
| 2801 | seen = append(seen, msg) |
| 2802 | if batch, ok := msg.(tea.BatchMsg); ok { |
| 2803 | for _, c := range batch { |
| 2804 | if c == nil { |
| 2805 | continue |
| 2806 | } |
| 2807 | bm, bcmd := m.Update(c()) |
| 2808 | m = bm |
| 2809 | queue = append(queue, bcmd) |
| 2810 | } |
| 2811 | continue |
| 2812 | } |
| 2813 | var nextCmd tea.Cmd |
| 2814 | m, nextCmd = m.Update(msg) |
| 2815 | queue = append(queue, nextCmd) |
| 2816 | } |
| 2817 | return m, seen |
| 2818 | } |
| 2819 | |
| 2820 | // TestPopoverRenderHasNoMarker: no row in the rendered popover is prefixed |
| 2821 | // with the old `▸ ` arrow or a 2-space marker. Selection is a colour change, |
| 2822 | // not a marker. |
| 2823 | func TestPopoverRenderHasNoMarker(t *testing.T) { |
| 2824 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 2825 | mm := typeInto(m, "/") |
| 2826 | rendered := stripANSI(mm.renderPopover()) |
| 2827 | for line := range strings.SplitSeq(rendered, "\n") { |
| 2828 | if strings.HasPrefix(line, "▸ ") || strings.HasPrefix(line, " /") { |
| 2829 | t.Fatalf("popover row must not carry a marker prefix: %q", line) |
| 2830 | } |