Skip to content

Commit 3543e41

Browse files
authored
Add a test that the default border is actually the default (#200)
* Add a test that the default border is actually the default * Use error message in assert fails
1 parent 16760a9 commit 3543e41

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

table/options_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,27 @@ func TestSelectRowsProgramatically(t *testing.T) {
236236
}
237237
}
238238

239+
func TestDefaultBorderIsDefault(t *testing.T) {
240+
model := New([]Column{
241+
NewColumn("id", "ID", 1),
242+
}).WithRows([]Row{
243+
NewRow(RowData{"id": 1}),
244+
NewRow(RowData{"id": 2}),
245+
NewRow(RowData{"id": 3}),
246+
})
247+
248+
renderedInitial := model.View()
249+
250+
model = model.BorderRounded()
251+
renderedRounded := model.View()
252+
253+
model = model.BorderDefault()
254+
renderedDefault := model.View()
255+
256+
assert.NotEqual(t, renderedInitial, renderedRounded, "Rounded border should differ from default")
257+
assert.Equal(t, renderedInitial, renderedDefault, "Default border should match initial state")
258+
}
259+
239260
func BenchmarkSelectedRows(b *testing.B) {
240261
const N = 1000
241262

0 commit comments

Comments
 (0)