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 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.
2823func 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 }

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