@@ -17,18 +17,19 @@ describe("NotificationsIOS", () => {
17
17
18
18
/*eslint-disable indent*/
19
19
let deviceAddEventListener ,
20
- deviceRemoveEventListener ,
21
- nativeAppAddEventListener ,
22
- nativeAppRemoveEventListener ,
23
- nativeRequestPermissionsWithCategories ,
24
- nativeAbandonPermissions ,
25
- nativeRegisterPushKit ,
26
- nativeBackgroundTimeRemaining ,
27
- nativeConsumeBackgroundQueue ,
28
- nativeLocalNotification ,
29
- nativeCancelLocalNotification ,
30
- nativeCancelAllLocalNotifications ,
31
- nativeSetBadgesCount ;
20
+ deviceRemoveEventListener ,
21
+ nativeAppAddEventListener ,
22
+ nativeAppRemoveEventListener ,
23
+ nativeRequestPermissionsWithCategories ,
24
+ nativeAbandonPermissions ,
25
+ nativeRegisterPushKit ,
26
+ nativeBackgroundTimeRemaining ,
27
+ nativeConsumeBackgroundQueue ,
28
+ nativeLocalNotification ,
29
+ nativeCancelLocalNotification ,
30
+ nativeCancelAllLocalNotifications ,
31
+ nativeSetBadgesCount ,
32
+ nativeIsRegisteredForRemoteNotifications ;
32
33
33
34
let NotificationsIOS , NotificationAction , NotificationCategory ;
34
35
let someHandler = ( ) => { } ;
@@ -49,6 +50,7 @@ describe("NotificationsIOS", () => {
49
50
nativeCancelLocalNotification = sinon . spy ( ) ;
50
51
nativeCancelAllLocalNotifications = sinon . spy ( ) ;
51
52
nativeSetBadgesCount = sinon . spy ( ) ;
53
+ nativeIsRegisteredForRemoteNotifications = sinon . spy ( ) ;
52
54
53
55
let libUnderTest = proxyquire ( "../index.ios" , {
54
56
"uuid" : {
@@ -65,7 +67,8 @@ describe("NotificationsIOS", () => {
65
67
localNotification : nativeLocalNotification ,
66
68
cancelLocalNotification : nativeCancelLocalNotification ,
67
69
cancelAllLocalNotifications : nativeCancelAllLocalNotifications ,
68
- setBadgesCount : nativeSetBadgesCount
70
+ setBadgesCount : nativeSetBadgesCount ,
71
+ isRegisteredForRemoteNotifications : nativeIsRegisteredForRemoteNotifications
69
72
}
70
73
} ,
71
74
NativeAppEventEmitter : {
@@ -104,6 +107,7 @@ describe("NotificationsIOS", () => {
104
107
nativeLocalNotification . reset ( ) ;
105
108
nativeCancelLocalNotification . reset ( ) ;
106
109
nativeCancelAllLocalNotifications . reset ( ) ;
110
+ nativeIsRegisteredForRemoteNotifications . reset ( ) ;
107
111
} ) ;
108
112
109
113
after ( ( ) => {
@@ -119,6 +123,7 @@ describe("NotificationsIOS", () => {
119
123
nativeLocalNotification = null ;
120
124
nativeCancelLocalNotification = null ;
121
125
nativeCancelAllLocalNotifications = null ;
126
+ nativeIsRegisteredForRemoteNotifications = null ;
122
127
123
128
NotificationsIOS = null ;
124
129
NotificationAction = null ;
@@ -295,4 +300,13 @@ describe("NotificationsIOS", () => {
295
300
expect ( nativeCancelAllLocalNotifications ) . to . have . been . calledWith ( ) ;
296
301
} ) ;
297
302
} ) ;
303
+
304
+
305
+ describe ( "Is registered for remote notifications " , ( ) => {
306
+ it ( "should call native is registered for remote notifications" , ( ) => {
307
+ NotificationsIOS . isRegisteredForRemoteNotifications ( ) ;
308
+ expect ( nativeIsRegisteredForRemoteNotifications ) . to . have . been . calledWith ( ) ;
309
+
310
+ } ) ;
311
+ } ) ;
298
312
} ) ;
0 commit comments