1
0
mirror of https://gitee.com/vant-contrib/vant.git synced 2025-04-06 03:57:59 +08:00
2018-05-30 20:35:30 +08:00

14 lines
381 B
JavaScript

import Switch from '..';
import { mount } from '@vue/test-utils';
test('emit event', () => {
const wrapper = mount(Switch);
wrapper.trigger('click');
wrapper.trigger('click');
wrapper.setProps({ disabled: true });
wrapper.trigger('click');
expect(wrapper.emitted('input')).toEqual([[true], [true]]);
expect(wrapper.emitted('change')).toEqual([[true], [true]]);
});