Skip to content

Commit c62130c

Browse files
author
Emmanouil Konstantinidis
committed
More notifications tests
1 parent e18ecde commit c62130c

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/js/__tests__/components/navigation.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* global jest, describe, beforeEach, it, expect */
1+
/* global jest, describe, beforeEach, it, expect, spyOn */
22

33
jest.dontMock('reflux');
44
jest.dontMock('../../actions/actions.js');
@@ -83,6 +83,28 @@ describe('Test for Navigation', function () {
8383
logoutIcon = TestUtils.scryRenderedDOMComponentsWithClass(instance, 'fa-sign-out');
8484
expect(logoutIcon.length).toBe(0);
8585

86+
// Refresh Completed
87+
instance.state.loading = true;
88+
instance.refreshDone();
89+
expect(instance.state.loading).toBeFalsy();
90+
91+
// Quit Application
92+
instance.appQuit();
93+
8694
});
8795

96+
it('Should test the refreshNotifications method', function () {
97+
98+
spyOn(Actions, 'getNotifications');
99+
100+
AuthStore.authStatus = function () {
101+
return true;
102+
};
103+
104+
var instance = TestUtils.renderIntoDocument(<Navigation />);
105+
instance.refreshNotifications();
106+
expect(Actions.getNotifications).toHaveBeenCalled();
107+
108+
});
109+
88110
});

0 commit comments

Comments
 (0)