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

24 lines
662 B
JavaScript
Raw Normal View History

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';
describe('TimePicker', () => {
2019-01-12 03:33:27 +00:00
focusTest(TimePicker);
it('renders addon correctly', () => {
const wrapper = mount({
2019-01-12 03:33:27 +00:00
render() {
return <TimePicker addon={() => <button type="button">Ok</button>} />;
},
2019-01-12 03:33:27 +00:00
});
const vcTimePicker = wrapper.find({ name: VcTimePicker.name });
const addonWrapper = mount({
2019-01-12 03:33:27 +00:00
render() {
return vcTimePicker.vm.addon();
},
2019-01-12 03:33:27 +00:00
});
expect(addonWrapper.html()).toMatchSnapshot();
});
});