diff options
Diffstat (limited to 'internal/tui/dashboard/model_test.go')
| -rw-r--r-- | internal/tui/dashboard/model_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/internal/tui/dashboard/model_test.go b/internal/tui/dashboard/model_test.go index c2dfbba..59af73a 100644 --- a/internal/tui/dashboard/model_test.go +++ b/internal/tui/dashboard/model_test.go @@ -56,6 +56,25 @@ func firstLineContaining(value, needle string) string { return "" } +func TestStreamViewportUsesSharedChromeCalculator(t *testing.T) { + wantWidth, wantHeight := common.EffectiveViewport(120, 40) + wantHeight -= streamChromeRows + + width, height := streamViewport(120, 40) + if width != wantWidth || height != wantHeight { + t.Fatalf("streamViewport() = %dx%d, want %dx%d", width, height, wantWidth, wantHeight) + } +} + +func TestFlameViewportClampsHeightWithExpandedHelp(t *testing.T) { + wantWidth, _ := common.EffectiveViewport(80, 2) + + width, height := flameViewport(80, 2, true) + if width != wantWidth || height != 1 { + t.Fatalf("flameViewport() = %dx%d, want %dx%d", width, height, wantWidth, 1) + } +} + func TestKeySwitchingChangesActiveTab(t *testing.T) { m := NewModelWithConfig(nil, nil, 250, common.DefaultKeyMap()) |
