2022-06-22 14:57:09 +08:00
|
|
|
import React from 'react';
|
2020-07-23 11:25:17 +08:00
|
|
|
import DatePicker from '..';
|
2022-08-18 17:40:47 +08:00
|
|
|
import { render } from '../../../tests/utils';
|
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();
|
2022-11-28 14:19:25 +08:00
|
|
|
const warnSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
2020-07-23 11:25:17 +08:00
|
|
|
|
2022-08-18 17:40:47 +08:00
|
|
|
const { container } = render(<QuarterPicker style={{ width: 400 }} />);
|
|
|
|
expect(container.firstChild).toMatchSnapshot();
|
2020-07-23 11:25:17 +08:00
|
|
|
|
|
|
|
expect(warnSpy).toHaveBeenCalledWith(
|
|
|
|
"Warning: [antd: QuarterPicker] DatePicker.QuarterPicker is legacy usage. Please use DatePicker[picker='quarter'] directly.",
|
|
|
|
);
|
|
|
|
|
|
|
|
warnSpy.mockRestore();
|
|
|
|
});
|
|
|
|
});
|