[new feauture] Notify: add onClose option

This commit is contained in:
陈嘉涵
2019-05-30 12:00:47 +08:00
parent 82134fe402
commit 333666f506
6 changed files with 18 additions and 3 deletions
+4 -1
View File
@@ -14,11 +14,13 @@ test('create a notify', async () => {
});
test('notify disappear', async () => {
const onClose = jest.fn();
const notify = Notify({
message: 'test',
color: 'red',
background: 'blue',
duration: 10
duration: 10,
onClose
});
await later();
@@ -26,6 +28,7 @@ test('notify disappear', async () => {
await later(20);
expect(notify.$el.outerHTML).toMatchSnapshot();
expect(onClose).toHaveBeenCalledTimes(1);
Notify({
message: 'text2',