Skip to content

Commit c6405f3

Browse files
committed
add test case
1 parent ab723a5 commit c6405f3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/sizer.test.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,23 @@ describe('Pagination with sizer', () => {
9292
{ value: '75', label: '75 条每页' },
9393
{ value: '100', label: '100 条每页' },
9494
];
95+
96+
it('showSizeChanger.className should be added to select node', async () => {
97+
const { container } = render(
98+
<Pagination
99+
defaultCurrent={1}
100+
total={500}
101+
selectComponentClass={Select}
102+
showSizeChanger={{
103+
className: 'custom-class-name',
104+
}}
105+
/>,
106+
);
107+
const select = container.querySelector('.rc-select');
108+
expect(select.className).toContain('custom-class-name');
109+
expect(select.className).toContain('rc-pagination-options-size-changer');
110+
});
111+
95112
it('should onChange called when pageSize change', () => {
96113
const onChange = jest.fn();
97114
const { container, getByRole } = render(

0 commit comments

Comments
 (0)