@@ -788,54 +788,48 @@ describe("push-notifications-gcm", () => {
788788 } ) ;
789789 } ) ;
790790
791- describe ( ' fcm_notification partial override (merge)' , ( ) => {
791+ describe ( " fcm_notification partial override (merge)" , ( ) => {
792792 before ( ( ) => {
793- sendMethod = sinon . stub (
794- gcm . Sender . prototype ,
795- 'send' ,
796- ( message , recipients , retries , cb ) => {
797- expect ( recipients ) . to . be . instanceOf ( Object ) ;
798- expect ( message ) . to . be . instanceOf ( gcm . Message ) ;
799- // Verify that title and body from main data are preserved
800- expect ( message . params . notification . title ) . to . equal ( data . title ) ;
801- expect ( message . params . notification . body ) . to . equal ( data . body ) ;
802- // Verify that fcm_notification overrides are applied
803- expect ( message . params . notification . color ) . to . equal ( '#FF0000' ) ;
804- // Verify custom data is present
805- expect ( message . params . data . sender ) . to . equal ( data . custom . sender ) ;
806-
807- cb ( null , {
808- multicast_id : 'abc' ,
809- success : recipients . registrationTokens . length ,
810- failure : 0 ,
811- results : recipients . registrationTokens . map ( ( token ) => ( {
812- message_id : '' ,
813- registration_id : token ,
814- error : null ,
815- } ) ) ,
816- } ) ;
817- }
818- ) ;
793+ sendMethod = sinon . stub ( gcm . Sender . prototype , "send" , ( message , recipients , retries , cb ) => {
794+ expect ( recipients ) . to . be . instanceOf ( Object ) ;
795+ expect ( message ) . to . be . instanceOf ( gcm . Message ) ;
796+ // Verify that title and body from main data are preserved
797+ expect ( message . params . notification . title ) . to . equal ( data . title ) ;
798+ expect ( message . params . notification . body ) . to . equal ( data . body ) ;
799+ // Verify that fcm_notification overrides are applied
800+ expect ( message . params . notification . color ) . to . equal ( "#FF0000" ) ;
801+ // Verify custom data is present
802+ expect ( message . params . data . sender ) . to . equal ( data . custom . sender ) ;
803+
804+ cb ( null , {
805+ multicast_id : "abc" ,
806+ success : recipients . registrationTokens . length ,
807+ failure : 0 ,
808+ results : recipients . registrationTokens . map ( ( token ) => ( {
809+ message_id : "" ,
810+ registration_id : token ,
811+ error : null ,
812+ } ) ) ,
813+ } ) ;
814+ } ) ;
819815 } ) ;
820816
821817 after ( ( ) => {
822818 sendMethod . restore ( ) ;
823819 } ) ;
824820
825- it ( ' should merge fcm_notification overrides with base notification' , ( done ) => {
821+ it ( " should merge fcm_notification overrides with base notification" , ( done ) => {
826822 const androidData = {
827823 ...data ,
828824 fcm_notification : {
829- color : ' #FF0000' , // Override only the color
825+ color : " #FF0000" , // Override only the color
830826 } ,
831827 } ;
832- pn . send ( regIds , androidData , ( err , results ) =>
833- testSuccess ( err , results , done )
834- ) ;
828+ pn . send ( regIds , androidData , ( err , results ) => testSuccess ( err , results , done ) ) ;
835829 } ) ;
836830 } ) ;
837831
838- describe ( ' send push notifications in phonegap-push compatibility mode' , ( ) => {
832+ describe ( " send push notifications in phonegap-push compatibility mode" , ( ) => {
839833 const pushPhoneGap = new PN ( {
840834 gcm : {
841835 phonegap : true ,
0 commit comments