Skip to content

Commit e4abf08

Browse files
committed
test for empty response list
1 parent 68f58a7 commit e4abf08

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/js/middleware/notifications.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,22 @@ describe('middleware/notifications.js', () => {
117117
expect(comms.updateTrayIcon).toHaveBeenCalledTimes(1);
118118
expect(comms.updateTrayIcon).toHaveBeenCalledWith(0);
119119
});
120+
121+
it('should show 0 notifications if no accounts logged in', () => {
122+
const action = {
123+
type: actions.NOTIFICATIONS.SUCCESS,
124+
payload: mockedNotificationsReducerData,
125+
};
126+
dispatchWithStoreOf(
127+
{
128+
...DEFAULT_STORE,
129+
notifications: {
130+
response: [],
131+
},
132+
},
133+
action
134+
);
135+
expect(comms.updateTrayIcon).toHaveBeenCalledTimes(1);
136+
expect(comms.updateTrayIcon).toHaveBeenCalledWith(4);
137+
});
120138
});

0 commit comments

Comments
 (0)