mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-16 01:43:21 +00:00
feat: include NormalBorder in DefaultStyles
This commit is contained in:
@@ -124,6 +124,7 @@ type Styles struct {
|
||||
// DefaultStyles returns a set of default style definitions for this table.
|
||||
func DefaultStyles() Styles {
|
||||
return Styles{
|
||||
Border: lipgloss.NormalBorder(),
|
||||
BorderHeader: true,
|
||||
Selected: lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("212")),
|
||||
Header: lipgloss.NewStyle().Bold(true).Padding(0, 1),
|
||||
|
||||
+2
-11
@@ -61,15 +61,10 @@ func deepEqual(a, b []Row) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// func TestWithColumns(t *testing.T) {
|
||||
// t.Run("With columns")
|
||||
//
|
||||
// t.Run("set headers directly")
|
||||
// }
|
||||
|
||||
func TestTableAlignment(t *testing.T) {
|
||||
t.Run("No border", func(t *testing.T) {
|
||||
s := DefaultStyles()
|
||||
s.Border = lipgloss.HiddenBorder()
|
||||
s.BorderHeader = false
|
||||
biscuits := New(
|
||||
WithHeight(5),
|
||||
@@ -89,10 +84,6 @@ func TestTableAlignment(t *testing.T) {
|
||||
golden.RequireEqual(t, []byte(got))
|
||||
})
|
||||
t.Run("With border", func(t *testing.T) {
|
||||
s := DefaultStyles()
|
||||
s.Border = lipgloss.NormalBorder()
|
||||
s.BorderStyle = lipgloss.NewStyle().BorderForeground(lipgloss.Color("240"))
|
||||
|
||||
biscuits := New(
|
||||
WithHeight(5),
|
||||
WithColumns([]Column{
|
||||
@@ -105,7 +96,7 @@ func TestTableAlignment(t *testing.T) {
|
||||
{"Tim Tams", "Australia", "No"},
|
||||
{"Hobnobs", "UK", "Yes"},
|
||||
}),
|
||||
WithStyles(s),
|
||||
WithStyles(DefaultStyles()),
|
||||
)
|
||||
got := ansi.Strip(biscuits.View())
|
||||
golden.RequireEqual(t, []byte(got))
|
||||
|
||||
Reference in New Issue
Block a user