ant-design-vue/components/date-picker/__tests__/WeekPicker.test.js

28 lines
672 B
JavaScript
Raw Normal View History

2019-01-12 03:33:27 +00:00
import { mount } from '@vue/test-utils';
2022-01-10 02:22:55 +00:00
import { asyncExpect, setMockDate } from '../../../tests/utils';
2019-01-12 03:33:27 +00:00
import DatePicker from '..';
import focusTest from '../../../tests/shared/focusTest';
2018-06-09 05:14:14 +00:00
2019-01-12 03:33:27 +00:00
const { WeekPicker } = DatePicker;
jest.mock('../../_util/Portal');
describe('WeekPicker', () => {
2022-01-10 02:22:55 +00:00
beforeEach(() => {
setMockDate();
});
2019-01-12 03:33:27 +00:00
focusTest(WeekPicker);
2018-06-09 05:14:14 +00:00
it('should support style prop', async () => {
2019-01-12 03:33:27 +00:00
const wrapper = mount(
{
render() {
return <WeekPicker style={{ width: '400px' }} />;
},
2018-06-09 05:14:14 +00:00
},
2019-01-12 03:33:27 +00:00
{ sync: false },
);
2018-06-09 05:14:14 +00:00
await asyncExpect(() => {
2019-01-12 03:33:27 +00:00
expect(wrapper.html()).toMatchSnapshot();
});
});
});