[bugfix] AddressList: not trigger select event when click radio icon (#3214)

This commit is contained in:
neverland
2019-04-26 09:25:57 +08:00
committed by GitHub
parent 5889968f29
commit 6fbdc4ffc3
2 changed files with 31 additions and 7 deletions

View File

@@ -26,3 +26,21 @@ test('unswitchable', () => {
expect(wrapper).toMatchSnapshot();
});
test('select event', () => {
const onSelect = jest.fn();
const wrapper = mount(AddressList, {
propsData: {
list
},
context: {
on: {
select: onSelect
}
}
});
wrapper.find('.van-radio__icon').trigger('click');
expect(onSelect).toHaveBeenCalled();
});