mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 18:14:13 +00:00
[Improvement] Switch: add test cases (#1202)
This commit is contained in:
13
packages/switch-cell/test/index.spec.js
Normal file
13
packages/switch-cell/test/index.spec.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import SwitchCell from '..';
|
||||
import { mount } from '@vue/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();
|
||||
});
|
Reference in New Issue
Block a user