MCPcopy Index your code
hub / github.com/codehamr/codehamr / TestPopoverRenderRightAligns

Function TestPopoverRenderRightAligns

internal/tui/tui_test.go:2889–2905  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

newTestModelFunction · 0.85
typeIntoFunction · 0.85
stripANSIFunction · 0.85
renderPopoverMethod · 0.80

Tested by

no test coverage detected