feat(Field): add click-input event (#6239)

This commit is contained in:
chenjiahan
2020-05-08 20:54:31 +08:00
parent f344334e12
commit a7968c5f6e
4 changed files with 45 additions and 19 deletions
+19 -1
View File
@@ -17,7 +17,25 @@ test('click event', () => {
expect(wrapper.emitted('click')[0][0]).toBeTruthy();
});
test('click icon event', () => {
test('click-input event', () => {
const wrapper = mount(Field);
wrapper.find('input').trigger('click');
expect(wrapper.emitted('click-input')[0][0]).toBeTruthy();
});
test('click-input event when using input slot', () => {
const wrapper = mount(Field, {
scopedSlots: {
input: () => 'Custom Input',
},
});
wrapper.find('.van-field__control').trigger('click');
expect(wrapper.emitted('click-input')[0][0]).toBeTruthy();
});
test('click-icon event', () => {
const wrapper = mount(Field, {
propsData: {
value: 'a',