2022-05-26 17:14:05 +08:00
|
|
|
import React from 'react';
|
2024-04-08 14:04:08 +08:00
|
|
|
|
2022-05-26 17:14:05 +08:00
|
|
|
import ConfigProvider from '..';
|
|
|
|
import { render } from '../../../tests/utils';
|
|
|
|
import Pagination from '../../pagination';
|
|
|
|
|
|
|
|
describe('ConfigProvider.Pagination', () => {
|
|
|
|
it('showSizeChanger', () => {
|
|
|
|
// Default have
|
|
|
|
const sharedNode = <Pagination total={1000} />;
|
|
|
|
const { container: rawContainer } = render(sharedNode);
|
|
|
|
expect(rawContainer.querySelector('.ant-pagination-options-size-changer')).toBeTruthy();
|
|
|
|
|
|
|
|
const { container } = render(
|
|
|
|
<ConfigProvider pagination={{ showSizeChanger: false }}>{sharedNode}</ConfigProvider>,
|
|
|
|
);
|
|
|
|
expect(container.querySelector('.ant-pagination-options-size-changer')).toBeFalsy();
|
|
|
|
});
|
|
|
|
});
|