[bugfix] ContactList: not trigger select event when click radio icon (#3218)

This commit is contained in:
neverland
2019-04-26 11:15:33 +08:00
committed by GitHub
parent 6fbdc4ffc3
commit 5ae6d3aabc
4 changed files with 69 additions and 36 deletions
+23 -1
View File
@@ -43,9 +43,31 @@ describe('ContactCard', () => {
describe('ContactList', () => {
test('render', () => {
const wrapper = mount(ContactList);
const wrapper = mount(ContactList, {
propsData: {
list: [contactInfo]
}
});
expect(wrapper).toMatchSnapshot();
});
test('select event', () => {
const onSelect = jest.fn();
const wrapper = mount(ContactList, {
propsData: {
list: [contactInfo]
},
context: {
on: {
select: onSelect
}
}
});
wrapper.find('.van-radio__icon').trigger('click');
expect(onSelect).toHaveBeenCalled();
});
});
describe('ContactEdit', () => {