Skip to content

Commit

Permalink
Revert "test(layout): add grid layout test"
Browse files Browse the repository at this point in the history
This reverts commit b10915b.
  • Loading branch information
bashbunni committed Jan 9, 2025
1 parent 4d652c1 commit b633a2d
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 59 deletions.
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ 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
)

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
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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=
Expand Down
1 change: 1 addition & 0 deletions group.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
30 changes: 0 additions & 30 deletions huh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down Expand Up @@ -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"))).
Expand Down
23 changes: 0 additions & 23 deletions testdata/TestLayoutGrid.golden

This file was deleted.

0 comments on commit b633a2d

Please sign in to comment.