@@ -184,7 +184,7 @@ describe('APNS', () => {
184
184
'key' : 'value' ,
185
185
'keyAgain' : 'valueAgain'
186
186
} ) ;
187
- expect ( notification . expiry ) . toEqual ( expirationTime / 1000 ) ;
187
+ expect ( notification . expiry ) . toEqual ( Math . round ( expirationTime / 1000 ) ) ;
188
188
expect ( notification . collapseId ) . toEqual ( collapseId ) ;
189
189
done ( ) ;
190
190
} ) ;
@@ -208,7 +208,7 @@ describe('APNS', () => {
208
208
209
209
let notification = APNS . _generateNotification ( data , { expirationTime : expirationTime , collapseId : collapseId } ) ;
210
210
211
- expect ( notification . expiry ) . toEqual ( expirationTime / 1000 ) ;
211
+ expect ( notification . expiry ) . toEqual ( Math . round ( expirationTime / 1000 ) ) ;
212
212
expect ( notification . collapseId ) . toEqual ( collapseId ) ;
213
213
214
214
let stringifiedJSON = notification . compile ( ) ;
@@ -307,7 +307,7 @@ describe('APNS', () => {
307
307
let calledArgs = provider . send . calls . first ( ) . args ;
308
308
let notification = calledArgs [ 0 ] ;
309
309
expect ( notification . aps . alert ) . toEqual ( data . data . alert ) ;
310
- expect ( notification . expiry ) . toEqual ( data [ 'expiration_time' ] / 1000 ) ;
310
+ expect ( notification . expiry ) . toEqual ( Math . round ( data [ 'expiration_time' ] / 1000 ) ) ;
311
311
expect ( notification . collapseId ) . toEqual ( data [ 'collapse_id' ] ) ;
312
312
let apnDevices = calledArgs [ 1 ] ;
313
313
expect ( apnDevices . length ) . toEqual ( 4 ) ;
@@ -383,7 +383,7 @@ describe('APNS', () => {
383
383
let calledArgs = provider . send . calls . first ( ) . args ;
384
384
let notification = calledArgs [ 0 ] ;
385
385
expect ( notification . aps . alert ) . toEqual ( data . data . alert ) ;
386
- expect ( notification . expiry ) . toEqual ( data [ 'expiration_time' ] / 1000 ) ;
386
+ expect ( notification . expiry ) . toEqual ( Math . round ( data [ 'expiration_time' ] / 1000 ) ) ;
387
387
expect ( notification . collapseId ) . toEqual ( data [ 'collapse_id' ] ) ;
388
388
let apnDevices = calledArgs [ 1 ] ;
389
389
expect ( apnDevices . length ) . toBe ( 3 ) ;
@@ -392,7 +392,7 @@ describe('APNS', () => {
392
392
calledArgs = providerDev . send . calls . first ( ) . args ;
393
393
notification = calledArgs [ 0 ] ;
394
394
expect ( notification . aps . alert ) . toEqual ( data . data . alert ) ;
395
- expect ( notification . expiry ) . toEqual ( data [ 'expiration_time' ] / 1000 ) ;
395
+ expect ( notification . expiry ) . toEqual ( Math . round ( data [ 'expiration_time' ] / 1000 ) ) ;
396
396
expect ( notification . collapseId ) . toEqual ( data [ 'collapse_id' ] ) ;
397
397
apnDevices = calledArgs [ 1 ] ;
398
398
expect ( apnDevices . length ) . toBe ( 2 ) ;
0 commit comments