2019-01-12 03:33:27 +00:00
|
|
|
import { mount } from '@vue/test-utils';
|
|
|
|
import VcTimePicker from '../../vc-time-picker/TimePicker';
|
|
|
|
import TimePicker from '..';
|
|
|
|
import focusTest from '../../../tests/shared/focusTest';
|
2018-06-17 07:57:09 +00:00
|
|
|
|
|
|
|
describe('TimePicker', () => {
|
2019-01-12 03:33:27 +00:00
|
|
|
focusTest(TimePicker);
|
2018-06-17 07:57:09 +00:00
|
|
|
|
|
|
|
it('renders addon correctly', () => {
|
|
|
|
const wrapper = mount({
|
2019-01-12 03:33:27 +00:00
|
|
|
render() {
|
|
|
|
return <TimePicker addon={() => <button type="button">Ok</button>} />;
|
2018-06-17 07:57:09 +00:00
|
|
|
},
|
2019-01-12 03:33:27 +00:00
|
|
|
});
|
|
|
|
const vcTimePicker = wrapper.find({ name: VcTimePicker.name });
|
2018-06-17 07:57:09 +00:00
|
|
|
const addonWrapper = mount({
|
2019-01-12 03:33:27 +00:00
|
|
|
render() {
|
|
|
|
return vcTimePicker.vm.addon();
|
2018-06-17 07:57:09 +00:00
|
|
|
},
|
2019-01-12 03:33:27 +00:00
|
|
|
});
|
|
|
|
expect(addonWrapper.html()).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|