mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 18:14:13 +00:00
[new feature] Field: add click-left-icon event (#2605)
This commit is contained in:
@@ -15,13 +15,17 @@ test('click icon event', () => {
|
||||
const wrapper = mount(Field, {
|
||||
propsData: {
|
||||
value: 'a',
|
||||
icon: 'search',
|
||||
leftIcon: 'contact',
|
||||
rightIcon: 'search',
|
||||
onIconClick
|
||||
}
|
||||
});
|
||||
|
||||
wrapper.find('.van-field__icon').trigger('click');
|
||||
wrapper.find('.van-field__left-icon').trigger('click');
|
||||
wrapper.find('.van-field__right-icon').trigger('click');
|
||||
expect(wrapper.emitted('click-icon')).toBeTruthy();
|
||||
expect(wrapper.emitted('click-left-icon')).toBeTruthy();
|
||||
expect(wrapper.emitted('click-right-icon')).toBeTruthy();
|
||||
expect(onIconClick.mock.calls.length).toBe(1);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user