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. (#1017)
  • Loading branch information
bbb169 authored Sep 1, 2023
1 parent 719d285 commit 86f5cab
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

1 comment on commit 86f5cab

@vercel
Copy link

@vercel vercel bot commented on 86f5cab Sep 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

table – ./

table-git-master-react-component.vercel.app
table-react-component.vercel.app

Please sign in to comment.