2020-07-23 11:25:17 +08:00
|
|
|
import { mount } from 'enzyme';
|
2022-06-22 14:57:09 +08:00
|
|
|
import React from 'react';
|
2020-07-23 11:25:17 +08:00
|
|
|
import DatePicker from '..';
|
2022-05-10 15:43:29 +08:00
|
|
|
import { resetWarned } from '../../_util/warning';
|
2020-07-23 11:25:17 +08:00
|
|
|
|
|
|
|
const { QuarterPicker } = DatePicker;
|
|
|
|
|
|
|
|
describe('QuarterPicker', () => {
|
|
|
|
it('should support style prop', () => {
|
|
|
|
resetWarned();
|
|
|
|
const warnSpy = jest.spyOn(console, 'error');
|
|
|
|
|
|
|
|
const wrapper = mount(<QuarterPicker style={{ width: 400 }} />);
|
|
|
|
expect(wrapper.render()).toMatchSnapshot();
|
|
|
|
|
|
|
|
expect(warnSpy).toHaveBeenCalledWith(
|
|
|
|
"Warning: [antd: QuarterPicker] DatePicker.QuarterPicker is legacy usage. Please use DatePicker[picker='quarter'] directly.",
|
|
|
|
);
|
|
|
|
|
|
|
|
warnSpy.mockRestore();
|
|
|
|
});
|
|
|
|
});
|