vant/packages/switch-cell/test/index.spec.js
2018-06-27 11:56:14 +08:00

14 lines
319 B
JavaScript

import SwitchCell from '..';
import { mount } from '../../../test/utils';
test('emit event', () => {
const wrapper = mount(SwitchCell);
wrapper.vm.$on('input', value => {
wrapper.setProps({ value });
});
wrapper.find('.van-switch').trigger('click');
expect(wrapper.emitted('change')).toBeTruthy();
});