1
0
mirror of https://gitee.com/vant-contrib/vant.git synced 2025-04-06 03:57:59 +08:00
2018-06-27 11:56:14 +08:00

14 lines
385 B
JavaScript

import Switch from '..';
import { mount } from '../../../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]]);
});