Skip to content

Commit ca686f2

Browse files
author
Emmanouil Konstantinidis
committed
More tests
1 parent cab3791 commit ca686f2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/js/__tests__/stores/notifications.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,23 @@ describe('Tests for NotificationsStore', function () {
149149

150150
});
151151

152+
it('should mark a notification as read - remove single notification from store', function () {
153+
154+
spyOn(NotificationsStore, 'trigger');
155+
156+
NotificationsStore._notifications = ['abc', 'def'];
157+
158+
expect(NotificationsStore._notifications.length).toBe(2);
159+
160+
Actions.removeNotification('abc');
161+
162+
jest.runAllTimers();
163+
164+
expect(NotificationsStore._notifications.length).toBe(1);
165+
expect(NotificationsStore.trigger).toHaveBeenCalled();
166+
167+
});
168+
152169
it('should mark a repo as read - remove notifications from store', function () {
153170

154171
spyOn(NotificationsStore, 'trigger');

0 commit comments

Comments
 (0)