[new feature] AddressList: add click-item event (#3942)

This commit is contained in:
neverland
2019-07-23 20:50:31 +08:00
committed by GitHub
parent 4d0d54dbf4
commit 42afafac2b
5 changed files with 29 additions and 2 deletions
+18
View File
@@ -44,3 +44,21 @@ test('select event', () => {
expect(onSelect).toHaveBeenCalledTimes(1);
});
test('click-item event', () => {
const onClickItem = jest.fn();
const wrapper = mount(AddressList, {
propsData: {
list
},
context: {
on: {
'click-item': onClickItem
}
}
});
wrapper.find('.van-address-item').trigger('click');
expect(onClickItem).toHaveBeenCalledTimes(1);
});