test: re-enable tests and record golden files after fixes on lipgloss

https://github.com/charmbracelet/lipgloss/pull/526
This commit is contained in:
Andrey Nering
2025-05-28 17:35:33 -03:00
parent 8acc3deec8
commit 78e9bc479c
11 changed files with 89 additions and 38 deletions
+2 -13
View File
@@ -249,12 +249,12 @@ func TestSetBorder(t *testing.T) {
borders []bool
}{
{"UnsetAllBorders", []bool{false}},
//{"SetAllBorders", []bool{true}}, // FIXME(@andreynering): Fix on Lip Gloss. Unneeded extra row.
{"SetAllBorders", []bool{true}},
{"VerticalBordersOnly", []bool{true, false}},
{"NoTopBorder", []bool{false, true, true}},
{"NoLeftBorder", []bool{true, true, true, false}},
{"RowSeparatorAndNoRightBorder", []bool{true, false, true, true, true}},
//{"SetRowAndColumnSeparators", []bool{false, false, false, false, true, true}}, // FIXME(@andreynering): Broken style, does this make sense?
{"SetRowAndColumnSeparators", []bool{false, false, false, false, true, true}},
{"InvalidNumberOfArguments", []bool{true, false, false, false, false, true, true}},
}
for _, tc := range tests {
@@ -673,7 +673,6 @@ func TestModel_View(t *testing.T) {
)
},
},
// FIXME(@andreynering): Fix this scenario in Lip Gloss
"ExtraPadding": {
modelFunc: func() *Model {
s := DefaultStyles()
@@ -681,7 +680,6 @@ func TestModel_View(t *testing.T) {
s.Cell = lipgloss.NewStyle().Padding(2, 2)
return New(
WithHeight(10),
WithHeaders("Name", "Country of Origin", "Dunk-able"),
WithRows(
[]string{"Chocolate Digestives", "UK", "Yes"},
@@ -691,7 +689,6 @@ func TestModel_View(t *testing.T) {
WithStyles(s),
)
},
skip: true,
},
"NoPadding": {
modelFunc: func() *Model {
@@ -711,7 +708,6 @@ func TestModel_View(t *testing.T) {
)
},
},
// FIXME(@andreynering): Fix this scenario in Lip Gloss
"BorderedHeaders": {
modelFunc: func() *Model {
return New(
@@ -726,9 +722,7 @@ func TestModel_View(t *testing.T) {
}),
)
},
skip: true,
},
// FIXME(@andreynering): Fix this scenario in Lip Gloss
"BorderedCells": {
modelFunc: func() *Model {
return New(
@@ -743,7 +737,6 @@ func TestModel_View(t *testing.T) {
}),
)
},
skip: true,
},
// FIXME(@andreynering): Fix in Lip Gloss? Potentially add extra empty lines to the bottom of the table.
"ManualHeightGreaterThanRows": {
@@ -759,7 +752,6 @@ func TestModel_View(t *testing.T) {
)
},
},
// FIXME(@andreynering): Fix this scenario in Lip Gloss. Should truncate table if height is too small.
"ManualHeightLessThanRows": {
modelFunc: func() *Model {
return New(
@@ -772,7 +764,6 @@ func TestModel_View(t *testing.T) {
),
)
},
skip: true,
},
"ManualWidthGreaterThanColumns": {
modelFunc: func() *Model {
@@ -787,7 +778,6 @@ func TestModel_View(t *testing.T) {
)
},
},
// FIXME(@andreynering): Fix this scenario in Lip Gloss.
"ManualWidthLessThanColumns": {
modelFunc: func() *Model {
return New(
@@ -800,7 +790,6 @@ func TestModel_View(t *testing.T) {
),
)
},
skip: true,
},
}
+11
View File
@@ -0,0 +1,11 @@
┌────────────────────────────────────────────────────┐
│ Name   Country of Origin  Dunk-able │
├────────────────────────────────────────────────────┤
│ Chocolate Digestives  UK   Yes 
│┌────────────────────┐┌─────────────────┐┌─────────┐│
││Tim Tams ││Australia ││No ││
│└────────────────────┘└─────────────────┘└─────────┘│
│┌────────────────────┐┌─────────────────┐┌─────────┐│
││Hobnobs ││UK ││Yes ││
│└────────────────────┘└─────────────────┘└─────────┘│
└────────────────────────────────────────────────────┘
+9
View File
@@ -0,0 +1,9 @@
┌────────────────────────────────────────────────────┐
│┌────────────────────┐┌─────────────────┐┌─────────┐│
││Name ││Country of Origin││Dunk-able││
│└────────────────────┘└─────────────────┘└─────────┘│
├────────────────────────────────────────────────────┤
│ Chocolate Digestives  UK   Yes 
│ Tim Tams   Australia   No 
│ Hobnobs   UK   Yes 
└────────────────────────────────────────────────────┘
+19
View File
@@ -0,0 +1,19 @@
┌──────────────────────────────────────────────────────────┐
│ │
│ │
│  Name     Country of Origin    Dunk-able  │
│ │
│ │
├──────────────────────────────────────────────────────────┤
│ Chocolate Digestives   UK   Yes 
│ │
│ │
│  Tim Tams     Australia     No  
│ │
│ │
│ │
│ │
│  Hobnobs     UK     Yes  
│ │
│ │
└──────────────────────────────────────────────────────────┘
@@ -0,0 +1,2 @@
┌────────────────────────────────────────────────────┐
│ Name   Country of Origin  Dunk-able │
@@ -1,7 +1,7 @@
┌──────────────────────────────────────────────────────────────────────────────
│ Name   Country of Origin   Dunk-able 
├──────────────────────────────────────────────────────────────────────────────
│ Chocolate Digestives   UK   Yes 
│ Tim Tams   Australia   No 
│ Hobnobs   UK   Yes 
└──────────────────────────────────────────────────────────────────────────────
┌──────────────────────────────────────────────────────────────────────────────
│ Name   Country of Origin   Dunk-able 
├──────────────────────────────────────────────────────────────────────────────
│ Chocolate Digestives   UK   Yes 
│ Tim Tams   Australia   No 
│ Hobnobs   UK   Yes 
└──────────────────────────────────────────────────────────────────────────────
@@ -0,0 +1,10 @@
┌────────────────────────────┐
│ Name   Count…  Dunk-a… │
├────────────────────────────┤
│ Chocolate  UK   Yes 
│ Digestive 
│ s 
│ Tim Tams   Austra  No 
 lia 
│ Hobnobs   UK   Yes 
└────────────────────────────┘
@@ -2,15 +2,8 @@
│ Rank  City   Country   Population 
├────────────────────────────────────────────
│ 1   Tokyo   Japan   37,274,000 
├────────────────────────────────────────────
├────────────────────────────────────────────
│ 2   Delhi   India   32,065,760 
├────────────────────────────────────────────
│ 3   Shanghai   China   28,516,904 
├────────────────────────────────────────────┤
│ 4   Dhaka   Bangladesh  22,478,116 
├────────────────────────────────────────────┤
│ 5   São Paulo   Brazil   22,429,800 
├────────────────────────────────────────────┤
├────────────────────────────────────────────
│ …   …   …   … 
├────────────────────────────────────────────┤
└────────────────────────────────────────────
+9
View File
@@ -0,0 +1,9 @@
┌──────┬──────────────┬────────────┬────────────┐
│ Rank │ City  │ Country  │ Population │
├──────┼──────────────┼────────────┼────────────┤
│ 1  │ Tokyo  │ Japan  │ 37,274,000 │
├──────┼──────────────┼────────────┼────────────┤
│ 2  │ Delhi  │ India  │ 32,065,760 │
├──────┼──────────────┼────────────┼────────────┤
│ …  │ …  │ …  │ …  │
└──────┴──────────────┴────────────┴────────────┘
@@ -0,0 +1,9 @@
 Rank │ City  │ Country  │ Population 
──────┼──────────────┼────────────┼────────────
 1  │ Tokyo  │ Japan  │ 37,274,000 
──────┼──────────────┼────────────┼────────────
 2  │ Delhi  │ India  │ 32,065,760 
──────┼──────────────┼────────────┼────────────
 3  │ Shanghai  │ China  │ 28,516,904 
──────┼──────────────┼────────────┼────────────
 …  │ …  │ …  │ … 
+1 -1
View File
@@ -6,5 +6,5 @@
 4   Dhaka   Bangladesh  22,478,116 
 5   São Paulo   Brazil   22,429,800 
 6   Mexico City   Mexico   22,085,140 
 7   Cairo   Egypt   21,750,020 
 …   …   …   …