diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-05 21:50:58 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-05 21:50:58 +0200 |
| commit | a4298701546b09fccb15ce30db7c7e3f4070525c (patch) | |
| tree | b3433014284ccd354be48efb2ce125ccaf236d7e /internal/tui/tui_test.go | |
| parent | 2bd89ced830f97fd12a672fddb6978d204a014fd (diff) | |
fix(tui): stabilize full-width layout and sparkline rendering
Diffstat (limited to 'internal/tui/tui_test.go')
| -rw-r--r-- | internal/tui/tui_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/tui/tui_test.go b/internal/tui/tui_test.go index e15c937..68bfca0 100644 --- a/internal/tui/tui_test.go +++ b/internal/tui/tui_test.go @@ -20,6 +20,7 @@ import ( "charm.land/bubbles/v2/key" tea "charm.land/bubbletea/v2" + "charm.land/lipgloss/v2" ) type fakeProbeManager struct { @@ -680,3 +681,19 @@ func TestViewSetsDynamicWindowTitle(t *testing.T) { t.Fatalf("unexpected default window title: %q", view.WindowTitle) } } + +func TestRenderHelpOverlayUsesWideViewport(t *testing.T) { + groups := [][]key.Binding{{key.NewBinding(key.WithKeys("?"), key.WithHelp("?", "help"))}} + out := renderHelpOverlay(160, 40, groups) + + maxWidth := 0 + for _, line := range strings.Split(out, "\n") { + if w := lipgloss.Width(line); w > maxWidth { + maxWidth = w + } + } + + if maxWidth <= 110 { + t.Fatalf("expected wide help overlay to exceed previous 110-col cap, got %d", maxWidth) + } +} |
