From 6a22570057dd8fae20a0c4c5ae56ff79be9affc6 Mon Sep 17 00:00:00 2001 From: XieZongChen <46394163+amadeus711@users.noreply.github.com> Date: Wed, 13 Oct 2021 21:02:23 -0500 Subject: [PATCH] test(data-table): update test (#1358) --- src/data-table/tests/DataTable.spec.tsx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/data-table/tests/DataTable.spec.tsx b/src/data-table/tests/DataTable.spec.tsx index f0ae51eb7..15b07578c 100644 --- a/src/data-table/tests/DataTable.spec.tsx +++ b/src/data-table/tests/DataTable.spec.tsx @@ -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(() => ) + expect(wrapper.find('table').attributes('style')).toContain( + 'table-layout: auto' + ) + wrapper = mount(() => ( + + )) + expect(wrapper.find('table').attributes('style')).toContain( + 'table-layout: fixed' + ) + }) + it('should work with `virtual-scroll` prop', async () => { const columns = [ {