Skip to content

Commit

Permalink
test: inspect the content when initializing a table with the 'scrollX…
Browse files Browse the repository at this point in the history
…' property set.
  • Loading branch information
bbb169 committed Sep 1, 2023
1 parent 719d285 commit f94d2d8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/Scroll.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ describe('Table.Scroll', () => {
return <Table columns={columns} data={data} {...props} />;
};

it('should always has content when scroll.x is enabled', () => {
const data = [];
const createTable = props => {
return <Table data={data} {...props} />;
};

const wrapper = mount(createTable({ scroll: { x: true } }));

expect(wrapper.find('.rc-table-tbody').hostNodes().text()).toContain('No Data');
});

it('renders scroll.x is true', () => {
const wrapper = mount(createTable({ scroll: { x: true } }));
expect(wrapper.find('table').props().style.width).toEqual('auto');
Expand Down

0 comments on commit f94d2d8

Please sign in to comment.