ant-design/components/pagination/__tests__/simple.test.tsx
afc163 b154c9c8ae
fix: Pagination simple should support showTotal (#38399)
* fix: Pagination simple should support showTotal

* test: add test case
2022-11-06 15:58:48 +08:00

13 lines
494 B
TypeScript

import React from 'react';
import Pagination from '..';
import { render } from '../../../tests/utils';
describe('Pagination simple mode', () => {
it('should support showTotal in simple mode', () => {
const { container } = render(
<Pagination simple total={100} showTotal={(total: number, range: number[]) => `${range[0]}-${range[1]} of ${total} items`} />,
);
expect(container?.querySelector('.ant-pagination-total-text')).toHaveTextContent('1-10 of 100 items');
});
});