clone

fifteen puzzle games for the terminal, with daily puzzles, weekly ladders and xp, built on bubble tea

test fix

Dami committed e9a8d37
commit
e9a8d371e983730cf7cf10a2dbbb866f694d5d8b
parent
354e783cb6dce9375c7ed538d12edd55ea722c6a
author
Dami <dami.etoile@gmail.com>
1 file changed, +10 -10
Mapp/help_layout_test.go20++++++++++----------
M app/help_layout_test.go +10 -10
@@ -10,7 +10,7 @@ import (
1010 "charm.land/lipgloss/v2"1111 )1212 13-func TestHelpViewportSizeKeepsPanelInsideInsetBounds(t *testing.T) {13+func TestHelpViewportSizeKeepsPanelWithinWindowBounds(t *testing.T) {1414 const (1515 windowWidth = 1201616 windowHeight = 40
@@ -21,11 +21,11 @@ func TestHelpViewportSizeKeepsPanelInsideInsetBounds(t *testing.T) {
2121 content := strings.TrimSuffix(strings.Repeat(line+"\n", helpHeight), "\n")2222 panel := ui.Panel("Guide", content, "esc back")2323 24- if got := lipgloss.Width(panel); got > windowWidth-(helpPanelInsetX*2) {25- t.Fatalf("panel width = %d, want <= %d", got, windowWidth-(helpPanelInsetX*2))24+ if got := lipgloss.Width(panel); got > windowWidth {25+ t.Fatalf("panel width = %d, want <= %d", got, windowWidth)2626 }27- if got := lipgloss.Height(panel); got > windowHeight-(helpPanelInsetY*2) {28- t.Fatalf("panel height = %d, want <= %d", got, windowHeight-(helpPanelInsetY*2))27+ if got := lipgloss.Height(panel); got > windowHeight {28+ t.Fatalf("panel height = %d, want <= %d", got, windowHeight)2929 }3030 }3131
@@ -39,7 +39,7 @@ func TestHelpViewportSizeNeverFallsBelowOne(t *testing.T) {
3939 }4040 }4141 42-func TestHelpSelectListSizeKeepsPanelInsideInsetBounds(t *testing.T) {42+func TestHelpSelectListSizeKeepsPanelWithinWindowBounds(t *testing.T) {4343 const (4444 windowWidth = 1204545 windowHeight = 20
@@ -55,11 +55,11 @@ func TestHelpSelectListSizeKeepsPanelInsideInsetBounds(t *testing.T) {
5555 "↑/↓ navigate • enter select • esc back",5656 )5757 58- if got := lipgloss.Width(panel); got > windowWidth-(helpPanelInsetX*2) {59- t.Fatalf("panel width = %d, want <= %d", got, windowWidth-(helpPanelInsetX*2))58+ if got := lipgloss.Width(panel); got > windowWidth {59+ t.Fatalf("panel width = %d, want <= %d", got, windowWidth)6060 }61- if got := lipgloss.Height(panel); got > windowHeight-(helpPanelInsetY*2) {62- t.Fatalf("panel height = %d, want <= %d", got, windowHeight-(helpPanelInsetY*2))61+ if got := lipgloss.Height(panel); got > windowHeight {62+ t.Fatalf("panel height = %d, want <= %d", got, windowHeight)6363 }6464 }6565