test(data-table): update test (#1358)

This commit is contained in:
XieZongChen 2021-10-13 21:02:23 -05:00 committed by GitHub
parent 15261637f8
commit 6a22570057
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -740,6 +740,30 @@ describe('n-data-table', () => {
expect(wrapper.findAll('.n-data-table-td--summary')[1].text()).toBe('45')
})
it('should work with `table-layout` prop', async () => {
const columns = [
{
title: 'Name',
key: 'name'
}
]
const data = new Array(978).fill(0).map((_, index) => {
return {
name: index
}
})
let wrapper = mount(() => <NDataTable columns={columns} data={data} />)
expect(wrapper.find('table').attributes('style')).toContain(
'table-layout: auto'
)
wrapper = mount(() => (
<NDataTable columns={columns} data={data} table-layout="fixed" />
))
expect(wrapper.find('table').attributes('style')).toContain(
'table-layout: fixed'
)
})
it('should work with `virtual-scroll` prop', async () => {
const columns = [
{