MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestSplashEmittedOnFirstSize

Function TestSplashEmittedOnFirstSize

internal/tui/tui_test.go:2801–2827  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

2799 bm, bcmd := m.Update(c())
2800 m = bm
2801 queue = append(queue, bcmd)
2802 }
2803 continue
2804 }
2805 var nextCmd tea.Cmd
2806 m, nextCmd = m.Update(msg)
2807 queue = append(queue, nextCmd)
2808 }
2809 return m, seen
2810}
2811
2812// TestPopoverRenderHasNoMarker: no row in the rendered popover is prefixed
2813// with the old `▸ ` arrow or a 2-space marker. Selection is a colour change,
2814// not a marker.
2815func TestPopoverRenderHasNoMarker(t *testing.T) {
2816 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
2817 mm := typeInto(m, "/")
2818 rendered := stripANSI(mm.renderPopover())
2819 for line := range strings.SplitSeq(rendered, "\n") {
2820 if strings.HasPrefix(line, "▸ ") || strings.HasPrefix(line, " /") {
2821 t.Fatalf("popover row must not carry a marker prefix: %q", line)
2822 }
2823 }
2824}
2825
2826// TestPopoverSelectionStaysVisible: with more than popoverCap suggestions the
2827// popover renders a window; when the selection moves past it, renderPopover must
2828// scroll so the highlighted row stays shown, else Enter commits an unseen row.
2829func TestPopoverSelectionStaysVisible(t *testing.T) {
2830 m := Model{width: 80, suggestOpen: true}

Callers

nothing calls this directly

Calls 6

BootstrapFunction · 0.92
NewFunction · 0.92
stripANSIFunction · 0.85
ActiveProfileMethod · 0.80
updateMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected