diff --git a/app/pages/notifications/notification-section.jsx b/app/pages/notifications/notification-section.jsx
index d5b320c54b..9fa43ef8e3 100644
--- a/app/pages/notifications/notification-section.jsx
+++ b/app/pages/notifications/notification-section.jsx
@@ -19,6 +19,7 @@ export default class NotificationSection extends Component {
lastMeta: { },
loading: false,
notificationData: [],
+ notifications: [],
notificationsMap: { },
page: 1,
project: null
@@ -318,5 +319,6 @@ NotificationSection.contextTypes = {
NotificationSection.defaultProps = {
expanded: false,
- toggleSection: () => {}
+ toggleSection: () => {},
+ user: null
};
diff --git a/app/pages/notifications/notification-section.spec.js b/app/pages/notifications/notification-section.spec.js
index ad815ccbb6..d4bc6d28d3 100644
--- a/app/pages/notifications/notification-section.spec.js
+++ b/app/pages/notifications/notification-section.spec.js
@@ -138,12 +138,26 @@ describe('Notification Section', function() {
const notificationsCounter = {
update: sinon.stub()
};
- wrapper = shallow(
- ,
- { context: { notificationsCounter }, disableLifeCycleMethods: true }
- );
- wrapper.setState({ notifications: newNotifications });
- wrapper.instance().markAsRead(newNotifications[0]);
+
+ before(function () {
+ wrapper = shallow(
+ ,
+ {
+ context: { notificationsCounter },
+ disableLifeCycleMethods: true
+ }
+ );
+ wrapper.setState({
+ loading: false,
+ notificationData: [],
+ notifications: newNotifications
+ });
+ wrapper.instance().markAsRead(newNotifications[0]);
+ });
it('should update read notification as read (delivered)', function () {
assert.equal(newNotifications[0].update.calledWith({ delivered: true }), true);