@@ -172,12 +172,8 @@ describe('PushController', () => {
172172 send : function ( body , installations ) {
173173 var badge = body . data . badge ;
174174 installations . forEach ( ( installation ) => {
175- if ( installation . deviceType == "ios" ) {
176- expect ( installation . badge ) . toEqual ( badge ) ;
177- expect ( installation . originalBadge + 1 ) . toEqual ( installation . badge ) ;
178- } else {
179- expect ( installation . badge ) . toBeUndefined ( ) ;
180- }
175+ expect ( installation . badge ) . toEqual ( badge ) ;
176+ expect ( installation . originalBadge + 1 ) . toEqual ( installation . badge ) ;
181177 } )
182178 return successfulTransmissions ( body , installations ) ;
183179 } ,
@@ -203,7 +199,9 @@ describe('PushController', () => {
203199 while ( installations . length != 15 ) {
204200 const installation = new Parse . Object ( "_Installation" ) ;
205201 installation . set ( "installationId" , "installation_" + installations . length ) ;
206- installation . set ( "deviceToken" , "device_token_" + installations . length )
202+ installation . set ( "deviceToken" , "device_token_" + installations . length ) ;
203+ installation . set ( "badge" , installations . length ) ;
204+ installation . set ( "originalBadge" , installations . length ) ;
207205 installation . set ( "deviceType" , "android" ) ;
208206 installations . push ( installation ) ;
209207 }
@@ -238,12 +236,7 @@ describe('PushController', () => {
238236 expect ( results . length ) . toBe ( 15 ) ;
239237 for ( var i = 0 ; i < 15 ; i ++ ) {
240238 const installation = results [ i ] ;
241- if ( installation . get ( 'deviceType' ) == 'ios' ) {
242- expect ( installation . get ( 'badge' ) ) . toBe ( parseInt ( installation . get ( 'originalBadge' ) ) + 1 ) ;
243- } else {
244- expect ( installation . get ( 'badge' ) ) . toBe ( undefined ) ;
245- expect ( installation . get ( 'originalBadge' ) ) . toBe ( undefined ) ;
246- }
239+ expect ( installation . get ( 'badge' ) ) . toBe ( parseInt ( installation . get ( 'originalBadge' ) ) + 1 ) ;
247240 }
248241 done ( )
249242 } ) . catch ( ( err ) => {
0 commit comments