Skip to content

Commit 86f5cab

Browse files
authored
test: inspect the content when initializing a table with the 'scrollX' property set. (#1017)
1 parent 719d285 commit 86f5cab

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/Scroll.spec.jsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ describe('Table.Scroll', () => {
1515
return <Table columns={columns} data={data} {...props} />;
1616
};
1717

18+
it('should always has content when scroll.x is enabled', () => {
19+
const data = [];
20+
const createTable = props => {
21+
return <Table data={data} {...props} />;
22+
};
23+
24+
const wrapper = mount(createTable({ scroll: { x: true } }));
25+
26+
expect(wrapper.find('.rc-table-tbody').hostNodes().text()).toContain('No Data');
27+
});
28+
1829
it('renders scroll.x is true', () => {
1930
const wrapper = mount(createTable({ scroll: { x: true } }));
2031
expect(wrapper.find('table').props().style.width).toEqual('auto');

0 commit comments

Comments
 (0)