From b633a2dfa11a1dcbe2dbb0e699c9b62b81e9df5d Mon Sep 17 00:00:00 2001 From: bashbunni Date: Thu, 9 Jan 2025 06:21:20 -0800 Subject: [PATCH] Revert "test(layout): add grid layout test" This reverts commit b10915bf8cba67ebb32293f387f9f147e2bf12d8. --- go.mod | 2 -- go.sum | 4 ---- group.go | 1 + huh_test.go | 30 ------------------------------ testdata/TestLayoutGrid.golden | 23 ----------------------- 5 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 testdata/TestLayoutGrid.golden diff --git a/go.mod b/go.mod index 4a4774c5..be0de557 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,6 @@ require ( github.com/charmbracelet/bubbletea v1.2.2 github.com/charmbracelet/lipgloss v1.0.0 github.com/charmbracelet/x/ansi v0.4.5 - github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 github.com/mitchellh/hashstructure/v2 v2.0.2 ) @@ -16,7 +15,6 @@ require ( require ( github.com/atotto/clipboard v0.1.4 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect - github.com/aymanbagabas/go-udiff v0.2.0 // indirect github.com/charmbracelet/x/term v0.2.1 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect diff --git a/go.sum b/go.sum index 47e3b97b..4442611d 100644 --- a/go.sum +++ b/go.sum @@ -4,8 +4,6 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= -github.com/aymanbagabas/go-udiff v0.2.0 h1:TK0fH4MteXUDspT88n8CKzvK0X9O2xu9yQjWpi6yML8= -github.com/aymanbagabas/go-udiff v0.2.0/go.mod h1:RE4Ex0qsGkTAJoQdQQCA0uG+nAzJO/pI/QwceO5fgrA= github.com/catppuccin/go v0.2.0 h1:ktBeIrIP42b/8FGiScP9sgrWOss3lw0Z5SktRoithGA= github.com/catppuccin/go v0.2.0/go.mod h1:8IHJuMGaUUjQM82qBrGNBv7LFq6JI3NnQCF6MOlZjpc= github.com/charmbracelet/bubbles v0.20.0 h1:jSZu6qD8cRQ6k9OMfR1WlM+ruM8fkPWkHvQWD9LIutE= @@ -16,8 +14,6 @@ github.com/charmbracelet/lipgloss v1.0.0 h1:O7VkGDvqEdGi93X+DeqsQ7PKHDgtQfF8j8/O github.com/charmbracelet/lipgloss v1.0.0/go.mod h1:U5fy9Z+C38obMs+T+tJqst9VGzlOYGj4ri9reL3qUlo= github.com/charmbracelet/x/ansi v0.4.5 h1:LqK4vwBNaXw2AyGIICa5/29Sbdq58GbGdFngSexTdRM= github.com/charmbracelet/x/ansi v0.4.5/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= -github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b h1:MnAMdlwSltxJyULnrYbkZpp4k58Co7Tah3ciKhSNo0Q= -github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U= github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 h1:qko3AQ4gK1MTS/de7F5hPGx6/k1u0w4TeYmBFwzYVP4= github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0/go.mod h1:pBhA0ybfXv6hDjQUZ7hk1lVxBiUbupdw5R31yPUViVQ= github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= diff --git a/group.go b/group.go index 52a0109c..23bae6e5 100644 --- a/group.go +++ b/group.go @@ -298,6 +298,7 @@ func (g *Group) fullHeight() int { func (g *Group) getContent() (int, string) { var fields strings.Builder offset := 0 + gap := "\n\n" // if the focused field is requesting it be zoomed, only show that field. if g.selector.Selected().Zoom() { diff --git a/huh_test.go b/huh_test.go index 83f9eef8..57288b3b 100644 --- a/huh_test.go +++ b/huh_test.go @@ -13,7 +13,6 @@ import ( tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" "github.com/charmbracelet/x/ansi" - "github.com/charmbracelet/x/exp/golden" ) var pretty = lipgloss.NewStyle(). @@ -919,35 +918,6 @@ func TestAbort(t *testing.T) { } } -func TestLayoutGrid(t *testing.T) { - form := NewForm( - NewGroup( - NewInput().Title("First"), - NewInput().Title("Second"), - NewInput().Title("Third"), - ), - NewGroup( - NewInput().Title("Fourth"), - NewInput().Title("Fifth"), - NewInput().Title("Sixth"), - ), - NewGroup( - NewInput().Title("Seventh"), - NewInput().Title("Eigth"), - NewInput().Title("Nineth"), - NewInput().Title("Tenth"), - ), - NewGroup( - NewInput().Title("Eleventh"), - NewInput().Title("Twelveth"), - NewInput().Title("Thirteenth"), - ), - ).WithLayout(LayoutGrid(2, 2)).WithShowHelp(false) - want := ansi.Strip(form.View()) - t.Log(want) - golden.RequireEqual(t, []byte(want)) -} - // formProgram returns a new Form with a nil input and output, so it can be used as a test program. func formProgram() *Form { return NewForm(NewGroup(NewInput().Title("Foo"))). diff --git a/testdata/TestLayoutGrid.golden b/testdata/TestLayoutGrid.golden deleted file mode 100644 index 55fac680..00000000 --- a/testdata/TestLayoutGrid.golden +++ /dev/null @@ -1,23 +0,0 @@ - First Fourth - > > - - Second Fifth - > > - - Third Sixth - > > - - Seventh Eleventh - > > - - Eigth Twelveth - > > - - Nineth Thirteenth - > > - - Tenth - > - - - \ No newline at end of file