mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 03:11:15 +00:00
[new feature] Toast: add onClose prop (#2964)
This commit is contained in:
@@ -73,3 +73,16 @@ test('toast duration 0', () => {
|
||||
expect(toast.timer).toBeFalsy();
|
||||
Toast.allowMultiple(false);
|
||||
});
|
||||
|
||||
test('onClose callback', () => {
|
||||
Toast.allowMultiple();
|
||||
const onClose = jest.fn();
|
||||
const toast = Toast({
|
||||
message: 'toast',
|
||||
onClose
|
||||
});
|
||||
|
||||
toast.clear();
|
||||
Toast.allowMultiple(false);
|
||||
expect(onClose.mock.calls.length).toEqual(1);
|
||||
});
|
||||
|
Reference in New Issue
Block a user