import React from 'react';
import { render, mount } from 'enzyme';
import Pagination from '..';
import ConfigProvider from '../../config-provider';
import mountTest from '../../../tests/shared/mountTest';
import rtlTest from '../../../tests/shared/rtlTest';
describe('Pagination', () => {
mountTest(Pagination);
rtlTest(Pagination);
it('should be rendered correctly in RTL', () => {
const wrapper = mount(
,
);
expect(render(wrapper)).toMatchSnapshot();
});
it('should pass disabled to prev and next buttons', () => {
function itemRender(current, type, originalElement) {
if (type === 'prev') {
return ;
}
if (type === 'next') {
return ;
}
return originalElement;
}
const wrapper = mount();
expect(
wrapper
.find('button')
.at(0)
.props().disabled,
).toBe(true);
});
it('should autometically be small when size is not specified', async () => {
const wrapper = mount();
expect(
wrapper
.find('ul')
.at(0)
.hasClass('mini'),
).toBe(true);
});
});