feat(Toast): add closeOnClick option (#4192)

This commit is contained in:
neverland
2019-08-22 17:57:25 +08:00
committed by GitHub
parent 5603da5c73
commit d2b28432cd
6 changed files with 35 additions and 2 deletions
+16 -1
View File
@@ -140,8 +140,23 @@ test('onClose callback', () => {
});
toast.clear();
Toast.allowMultiple(false);
expect(onClose).toHaveBeenCalledTimes(1);
Toast.allowMultiple(false);
});
test('closeOnClick option', async () => {
Toast.allowMultiple();
const toast = Toast({
message: 'toast',
closeOnClick: true
});
await later();
toast.$el.click();
await later();
expect(toast.value).toBeFalsy();
Toast.allowMultiple(false);
});
test('register component', () => {