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 '..';
|
2017-11-19 01:41:40 +08:00
|
|
|
import focusTest from '../../../tests/shared/focusTest';
|
2016-12-14 14:48:09 +08:00
|
|
|
|
|
|
|
describe('TimePicker', () => {
|
2017-11-19 01:41:40 +08:00
|
|
|
focusTest(TimePicker);
|
|
|
|
|
2016-12-14 14:48:09 +08:00
|
|
|
it('renders addon correctly', () => {
|
2018-12-07 20:02:01 +08:00
|
|
|
const addon = () => <button type="button">Ok</button>;
|
2016-12-14 14:48:09 +08:00
|
|
|
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
|
|
|
});
|
|
|
|
});
|