@@ -6,14 +6,16 @@ import { mockedGithubNotifications, mockedNotificationsRecuderData } from '../..
66import notificationsMiddleware from '../../middleware/notifications' ;
77import NativeNotifications from '../../utils/notifications' ;
88
9+ // Keep 3 notifications
10+ // Ps. To receive 4 on actions.NOTIFICATIONS.SUCCESS,
911const mockedNotifications = mockedNotificationsRecuderData
1012 . deleteIn ( [ 0 , 'notifications' , 0 ] ) ;
1113
1214const createFakeStore = ( fakeData ) => ( {
1315 getState ( ) {
1416 return {
1517 notifications : Map ( {
16- response : mockedNotifications
18+ response : mockedNotifications ,
1719 } ) ,
1820 settings : Map ( {
1921 playSound : false ,
@@ -76,12 +78,15 @@ describe('middleware/notifications.js', () => {
7678 const action = {
7779 type : actions . MARK_REPO_NOTIFICATION . SUCCESS ,
7880 meta : {
79- repoSlug : 'manosim/gitify'
81+ repoSlug : 'manosim/notifications-test' ,
82+ hostname : 'github.com' ,
8083 }
8184 } ;
8285
8386 expect ( dispatchWithStoreOf ( { } , action ) ) . toEqual ( action ) ;
8487 expect ( comms . updateTrayIcon ) . toHaveBeenCalledTimes ( 1 ) ;
85- expect ( comms . updateTrayIcon ) . toHaveBeenCalledWith ( 3 ) ;
88+ expect ( comms . updateTrayIcon ) . toHaveBeenCalledWith ( 2 ) ;
89+ expect ( comms . setBadge ) . toHaveBeenCalledTimes ( 1 ) ;
90+ expect ( comms . setBadge ) . toHaveBeenCalledWith ( 2 ) ;
8691 } ) ;
8792} ) ;
0 commit comments