Skip to content

Commit

Permalink
feat: add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
fireairforce committed Jun 5, 2020
1 parent 60d7081 commit 17986fd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions components/list/__tests__/pagination.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,26 @@ describe('List.pagination', () => {
expect(wrapper.find('Pagination').first().render()).toMatchSnapshot();
});

// https://github.com/ant-design/ant-design/issues/24501
it('should onChange called when pageSize change', () => {
const handlePaginationChange = jest.fn();
const handlePageSizeChange = () => {};
const wrapper = mount(
createList({
pagination: {
...pagination,
showSizeChanger: true,
onChange: handlePaginationChange,
onShowSizeChange: handlePageSizeChange,
},
}),
);

wrapper.find('.ant-select-selector').simulate('mousedown');
wrapper.find('.ant-select-item-option').at(1).simulate('click');
expect(handlePaginationChange).toBeCalled();
});

it('should default work', () => {
const wrapper = mount(
createList({
Expand Down

0 comments on commit 17986fd

Please sign in to comment.