Skip to content

Commit 83d74d3

Browse files
committed
add test
1 parent 12f299b commit 83d74d3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/index.test.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,18 @@ describe('Other props', () => {
260260
expect(prev).toHaveStyle('color: red');
261261
expect(next).toHaveStyle('color: red');
262262
});
263+
it('should have 5 items when there are 3 pages and current page is 2', () => {
264+
const { container } = render(
265+
<Pagination
266+
total={15}
267+
pageSize={5}
268+
current={2}
269+
classNames={{ item: 'custom-test' }}
270+
/>,
271+
);
272+
const items = container.querySelectorAll('.custom-test');
273+
expect(items.length).toBe(5);
274+
});
263275
it('should support custom default icon', () => {
264276
const nextIcon = () => <span>nextIcon</span>;
265277
const prevIcon = () => <span>prevIcon</span>;

0 commit comments

Comments
 (0)