mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-23 06:58:33 +08:00
17 lines
562 B
JavaScript
17 lines
562 B
JavaScript
|
import React from 'react';
|
||
|
import { mount, render } from 'enzyme';
|
||
|
import { renderToJson } from 'enzyme-to-json';
|
||
|
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());
|
||
|
|
||
|
expect(renderToJson(addonWrapper)).toMatchSnapshot();
|
||
|
});
|
||
|
});
|