ant-design/components/date-picker/__tests__/other.test.js
偏右 f3911b3707 Feat week picker (#7404)
* New Component WeekPicker

close #212

* Add WeexPicker in API doc

* update snapshot

* Add test cases

* update snapshot
2017-08-31 20:44:22 +08:00

25 lines
796 B
JavaScript

import React from 'react';
import { mount, render } from 'enzyme';
import moment from 'moment';
import { MonthPicker, WeekPicker } from '../';
describe('MonthPicker and WeekPicker', () => {
it('render MonthPicker', () => {
const birthday = moment('2000-01-01', 'YYYY-MM-DD').locale('zh-cn');
const wrapper = mount(
<MonthPicker open />
);
wrapper.setProps({ value: birthday });
expect(render(wrapper.find('Trigger').node.getComponent())).toMatchSnapshot();
});
it('render WeekPicker', () => {
const birthday = moment('2000-01-01', 'YYYY-MM-DD').locale('zh-cn');
const wrapper = mount(
<WeekPicker open />
);
wrapper.setProps({ value: birthday });
expect(render(wrapper.find('Trigger').node.getComponent())).toMatchSnapshot();
});
});