fix: notification.destroy bug (#6161)

This commit is contained in:
Rex 2017-05-17 10:24:16 +08:00 committed by Benjy Cui
parent 56f8481709
commit f3c38d5811
2 changed files with 8 additions and 1 deletions

View File

@ -43,6 +43,13 @@ describe('notification', () => {
expect(document.querySelectorAll('.ant-notification-notice').length).toBe(0);
});
it('should be able to destroy after config', () => {
notification.config({
bottom: 100,
});
notification.destroy();
});
it('should be able to open with icon', () => {
const openNotificationWithIcon = (type) => {
const iconPrefix = '.ant-notification-notice-icon';

View File

@ -188,7 +188,7 @@ const api: {
if (notify) {
notify.destroy();
}
notificationInstance[defaultPlacement] = null;
delete notificationInstance[defaultPlacement];
}
if (duration !== undefined) {
defaultDuration = duration;