[new feature] Popup: add click event

This commit is contained in:
陈嘉涵
2019-04-30 19:10:19 +08:00
parent ef77166246
commit 848786dd6e
5 changed files with 21 additions and 4 deletions
+13 -2
View File
@@ -171,10 +171,21 @@ test('close on click modal', () => {
expect(wrapper.vm.value).toBeFalsy();
});
test('oepn & close event', () => {
wrapper = mount(Popup);
test('open & close event', () => {
const wrapper = mount(Popup);
wrapper.vm.value = true;
expect(wrapper.emitted('open')).toBeTruthy();
wrapper.vm.value = false;
expect(wrapper.emitted('close')).toBeTruthy();
});
test('click event', () => {
const wrapper = mount(Popup, {
propsData: {
value: true
}
});
wrapper.trigger('click');
expect(wrapper.emitted('click')).toBeTruthy();
});