@@ -668,6 +668,107 @@ describe('Taboola Adapter', function () {
668
668
const res = spec . interpretResponse ( serverResponse , request ) ;
669
669
expect ( res ) . to . deep . equal ( expectedRes ) ;
670
670
} ) ;
671
+
672
+ it ( 'should replace AUCTION_PRICE macro in adm' , function ( ) {
673
+ const multiRequest = {
674
+ bids : [
675
+ {
676
+ ...createBidRequest ( ) ,
677
+ ...displayBidRequestParams
678
+ } ,
679
+ {
680
+ ...createBidRequest ( ) ,
681
+ ...displayBidRequestParams
682
+ }
683
+ ]
684
+ }
685
+ const multiServerResponseWithMacro = {
686
+ body : {
687
+ 'id' : '49ffg4d58ef9a163a69fhgfghd4fad03621b9e036f24f7_15' ,
688
+ 'seatbid' : [
689
+ {
690
+ 'bid' : [
691
+ {
692
+ 'id' : '0b3dd94348-134b-435f-8db5-6bf5afgfc39e86c' ,
693
+ 'impid' : '2' ,
694
+ 'price' : 0.34 ,
695
+ 'adid' : '2785119545551083381' ,
696
+ 'adm' : 'ADM2,\\nwp:\'${AUCTION_PRICE}\'' ,
697
+ 'adomain' : [
698
+ 'example.xyz'
699
+ ] ,
700
+ 'cid' : '15744349' ,
701
+ 'crid' : '278195503434041083381' ,
702
+ 'w' : 300 ,
703
+ 'h' : 250 ,
704
+ 'exp' : 60 ,
705
+ 'lurl' : 'http://us-trc.taboola.com/sample' ,
706
+ 'nurl' : 'http://win.example.com/'
707
+ } ,
708
+ {
709
+ 'id' : '0b3dd94348-134b-435f-8db5-6bf5afgfc39e86c' ,
710
+ 'impid' : '1' ,
711
+ 'price' : 0.35 ,
712
+ 'adid' : '2785119545551083381' ,
713
+ 'adm' : 'ADM2,\\nwp:\'${AUCTION_PRICE}\'' ,
714
+ 'adomain' : [
715
+ 'example.xyz'
716
+ ] ,
717
+ 'cid' : '15744349' ,
718
+ 'crid' : '278195503434041083381' ,
719
+ 'w' : 300 ,
720
+ 'h' : 250 ,
721
+ 'exp' : 60 ,
722
+ 'lurl' : 'http://us-trc.taboola.com/sample' ,
723
+ 'nurl' : 'http://win.example.com/'
724
+
725
+ }
726
+ ] ,
727
+ 'seat' : '14204545260'
728
+ }
729
+ ] ,
730
+ 'bidid' : 'da43860a-4644-442a-b5e0-93f268cf8d19' ,
731
+ 'cur' : 'USD'
732
+ }
733
+ } ;
734
+ const [ bid ] = multiServerResponseWithMacro . body . seatbid [ 0 ] . bid ;
735
+ const expectedRes = [
736
+ {
737
+ requestId : multiRequest . bids [ 1 ] . bidId ,
738
+ cpm : multiServerResponseWithMacro . body . seatbid [ 0 ] . bid [ 0 ] . price ,
739
+ creativeId : bid . crid ,
740
+ ttl : 60 ,
741
+ netRevenue : true ,
742
+ currency : multiServerResponseWithMacro . body . cur ,
743
+ mediaType : 'banner' ,
744
+ ad : 'ADM2,\\nwp:\'0.34\'' ,
745
+ width : bid . w ,
746
+ height : bid . h ,
747
+ nurl : 'http://win.example.com/' ,
748
+ meta : {
749
+ 'advertiserDomains' : bid . adomain
750
+ } ,
751
+ } ,
752
+ {
753
+ requestId : multiRequest . bids [ 0 ] . bidId ,
754
+ cpm : multiServerResponseWithMacro . body . seatbid [ 0 ] . bid [ 1 ] . price ,
755
+ creativeId : bid . crid ,
756
+ ttl : 60 ,
757
+ netRevenue : true ,
758
+ currency : multiServerResponseWithMacro . body . cur ,
759
+ mediaType : 'banner' ,
760
+ ad : 'ADM2,\\nwp:\'0.35\'' ,
761
+ width : bid . w ,
762
+ height : bid . h ,
763
+ nurl : 'http://win.example.com/' ,
764
+ meta : {
765
+ 'advertiserDomains' : bid . adomain
766
+ } ,
767
+ }
768
+ ] ;
769
+ const res = spec . interpretResponse ( multiServerResponseWithMacro , multiRequest ) ;
770
+ expect ( res ) . to . deep . equal ( expectedRes ) ;
771
+ } ) ;
671
772
} )
672
773
673
774
describe ( 'getUserSyncs' , function ( ) {
0 commit comments