vant/packages/switch/test/index.spec.js
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]]);
});