[new feature] Notify: add onClick event

This commit is contained in:
陈嘉涵
2019-05-01 09:17:59 +08:00
parent 848786dd6e
commit 210122d518
8 changed files with 34 additions and 3 deletions
+11
View File
@@ -47,3 +47,14 @@ test('set default options', () => {
expect(Notify().duration).toEqual(3000);
Notify.clear();
});
test('onClick prop', async () => {
const onClick = jest.fn();
const notify = Notify({
message: 'test',
onClick
});
notify.$el.click();
expect(onClick).toHaveBeenCalled();
});