Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Sep 22, 2024
1 parent ab723a5 commit c6405f3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/sizer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,23 @@ describe('Pagination with sizer', () => {
{ value: '75', label: '75 条每页' },
{ value: '100', label: '100 条每页' },
];

it('showSizeChanger.className should be added to select node', async () => {
const { container } = render(
<Pagination
defaultCurrent={1}
total={500}
selectComponentClass={Select}
showSizeChanger={{
className: 'custom-class-name',
}}
/>,
);
const select = container.querySelector('.rc-select');
expect(select.className).toContain('custom-class-name');
expect(select.className).toContain('rc-pagination-options-size-changer');
});

it('should onChange called when pageSize change', () => {
const onChange = jest.fn();
const { container, getByRole } = render(
Expand Down

0 comments on commit c6405f3

Please sign in to comment.