ant-design/components/time-picker/__tests__/index.test.js

16 lines
501 B
JavaScript
Raw Normal View History

2016-12-14 14:48:09 +08:00
import React from 'react';
import { mount, render } from 'enzyme';
import RcTimePicker from 'rc-time-picker/lib/TimePicker';
import TimePicker from '..';
describe('TimePicker', () => {
it('renders addon correctly', () => {
const addon = () => (<button>Ok</button>);
const wrapper = mount(<TimePicker addon={addon} />);
const rcTimePicker = wrapper.find(RcTimePicker);
const addonWrapper = render(rcTimePicker.props().addon());
2017-04-02 18:09:23 +08:00
expect(addonWrapper).toMatchSnapshot();
2016-12-14 14:48:09 +08:00
});
});