react-notification
Advanced tools
Comparing version 5.0.6 to 5.0.7
@@ -37,2 +37,6 @@ 'use strict'; | ||
_this.handleClick = _this.handleClick.bind(_this); | ||
if (_this.props.onDismiss && _this.props.isActive) { | ||
_this.dismissTimeout = setTimeout(_this.props.onDismiss, _this.props.dismissAfter); | ||
} | ||
return _this; | ||
@@ -39,0 +43,0 @@ } |
{ | ||
"name": "react-notification", | ||
"version": "5.0.6", | ||
"version": "5.0.7", | ||
"description": "Snackbar style notification component for React.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -163,2 +163,24 @@ import { Notification, NotificationStack } from '../src/index'; | ||
}); | ||
it('onDismiss fires correctly without prop change', done => { | ||
const handleDismiss = spy(); | ||
const wrapper = mount( | ||
<Notification | ||
message={mockNotification.message} | ||
dismissAfter={mockNotification.dismissAfter} | ||
onDismiss={handleDismiss} | ||
isActive | ||
/> | ||
); | ||
setTimeout(() => { | ||
try { | ||
expect(handleDismiss.calledOnce).to.equal(true); | ||
done(); | ||
} catch (e) { | ||
done(e); | ||
} | ||
}, mockNotification.dismissAfter); | ||
}) | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
359085
732