@@ -184,7 +184,7 @@ describe('APNS', () => {
184184 'key' : 'value' ,
185185 'keyAgain' : 'valueAgain'
186186 } ) ;
187- expect ( notification . expiry ) . toEqual ( expirationTime / 1000 ) ;
187+ expect ( notification . expiry ) . toEqual ( Math . round ( expirationTime / 1000 ) ) ;
188188 expect ( notification . collapseId ) . toEqual ( collapseId ) ;
189189 done ( ) ;
190190 } ) ;
@@ -208,7 +208,7 @@ describe('APNS', () => {
208208
209209 let notification = APNS . _generateNotification ( data , { expirationTime : expirationTime , collapseId : collapseId } ) ;
210210
211- expect ( notification . expiry ) . toEqual ( expirationTime / 1000 ) ;
211+ expect ( notification . expiry ) . toEqual ( Math . round ( expirationTime / 1000 ) ) ;
212212 expect ( notification . collapseId ) . toEqual ( collapseId ) ;
213213
214214 let stringifiedJSON = notification . compile ( ) ;
@@ -307,7 +307,7 @@ describe('APNS', () => {
307307 let calledArgs = provider . send . calls . first ( ) . args ;
308308 let notification = calledArgs [ 0 ] ;
309309 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 ) ) ;
311311 expect ( notification . collapseId ) . toEqual ( data [ 'collapse_id' ] ) ;
312312 let apnDevices = calledArgs [ 1 ] ;
313313 expect ( apnDevices . length ) . toEqual ( 4 ) ;
@@ -383,7 +383,7 @@ describe('APNS', () => {
383383 let calledArgs = provider . send . calls . first ( ) . args ;
384384 let notification = calledArgs [ 0 ] ;
385385 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 ) ) ;
387387 expect ( notification . collapseId ) . toEqual ( data [ 'collapse_id' ] ) ;
388388 let apnDevices = calledArgs [ 1 ] ;
389389 expect ( apnDevices . length ) . toBe ( 3 ) ;
@@ -392,7 +392,7 @@ describe('APNS', () => {
392392 calledArgs = providerDev . send . calls . first ( ) . args ;
393393 notification = calledArgs [ 0 ] ;
394394 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 ) ) ;
396396 expect ( notification . collapseId ) . toEqual ( data [ 'collapse_id' ] ) ;
397397 apnDevices = calledArgs [ 1 ] ;
398398 expect ( apnDevices . length ) . toBe ( 2 ) ;
0 commit comments