@@ -861,6 +861,51 @@ describe('targeting tests', function () {
861
861
} ) ;
862
862
} ) ;
863
863
864
+ describe ( 'targetingControls.alwaysIncludeDeals with enableSendAllBids' , function ( ) {
865
+ beforeEach ( function ( ) {
866
+ enableSendAllBids = true ;
867
+ } ) ;
868
+
869
+ it ( 'includes bids w/o deal when enableSendAllBids and alwaysIncludeDeals set to true' , function ( ) {
870
+ config . setConfig ( {
871
+ enableSendAllBids : true ,
872
+ targetingControls : {
873
+ alwaysIncludeDeals : true
874
+ }
875
+ } ) ;
876
+
877
+ let bid5 = utils . deepClone ( bid1 ) ;
878
+ bid5 . adserverTargeting = {
879
+ hb_pb : '3.0' ,
880
+ hb_adid : '111111' ,
881
+ hb_bidder : 'pubmatic' ,
882
+ foobar : '300x250'
883
+ } ;
884
+ bid5 . bidder = bid5 . bidderCode = 'pubmatic' ;
885
+ bid5 . cpm = 3.0 ; // winning bid!
886
+ delete bid5 . dealId ; // no deal with winner
887
+ bidsReceived . push ( bid5 ) ;
888
+
889
+ const targeting = targetingInstance . getAllTargeting ( [ '/123456/header-bid-tag-0' ] ) ;
890
+
891
+ // Pubmatic wins but no deal. But enableSendAllBids is true.
892
+ // So Pubmatic is passed through
893
+ expect ( targeting [ '/123456/header-bid-tag-0' ] ) . to . deep . equal ( {
894
+ 'hb_bidder' : 'pubmatic' ,
895
+ 'hb_adid' : '111111' ,
896
+ 'hb_pb' : '3.0' ,
897
+ 'foobar' : '300x250' ,
898
+ 'hb_pb_pubmatic' : '3.0' ,
899
+ 'hb_adid_pubmatic' : '111111' ,
900
+ 'hb_bidder_pubmatic' : 'pubmatic' ,
901
+ 'hb_deal_rubicon' : '1234' ,
902
+ 'hb_pb_rubicon' : '0.53' ,
903
+ 'hb_adid_rubicon' : '148018fe5e' ,
904
+ 'hb_bidder_rubicon' : 'rubicon'
905
+ } ) ;
906
+ } ) ;
907
+ } ) ;
908
+
864
909
it ( 'selects the top bid when enableSendAllBids true' , function ( ) {
865
910
enableSendAllBids = true ;
866
911
let targeting = targetingInstance . getAllTargeting ( [ '/123456/header-bid-tag-0' ] ) ;
0 commit comments