@@ -186,7 +186,8 @@ describe('auctionmanager.js', function () {
186
186
source : 'client' ,
187
187
mediaType : 'banner' ,
188
188
meta : {
189
- advertiserDomains : [ 'adomain' ]
189
+ advertiserDomains : [ 'adomain' ] ,
190
+ primaryCatId : 'IAB-test'
190
191
}
191
192
} ;
192
193
@@ -200,6 +201,7 @@ describe('auctionmanager.js', function () {
200
201
expected [ CONSTANTS . TARGETING_KEYS . SOURCE ] = bid . source ;
201
202
expected [ CONSTANTS . TARGETING_KEYS . FORMAT ] = bid . mediaType ;
202
203
expected [ CONSTANTS . TARGETING_KEYS . ADOMAIN ] = bid . meta . advertiserDomains [ 0 ] ;
204
+ expected [ CONSTANTS . TARGETING_KEYS . ACAT ] = bid . meta . primaryCatId ;
203
205
if ( bid . mediaType === 'video' ) {
204
206
expected [ CONSTANTS . TARGETING_KEYS . UUID ] = bid . videoCacheKey ;
205
207
expected [ CONSTANTS . TARGETING_KEYS . CACHE_ID ] = bid . videoCacheKey ;
@@ -290,6 +292,12 @@ describe('auctionmanager.js', function () {
290
292
val : function ( bidResponse ) {
291
293
return bidResponse . meta . advertiserDomains [ 0 ] ;
292
294
}
295
+ } ,
296
+ {
297
+ key : CONSTANTS . TARGETING_KEYS . ACAT ,
298
+ val : function ( bidResponse ) {
299
+ return bidResponse . meta . primaryCatId ;
300
+ }
293
301
}
294
302
]
295
303
@@ -367,6 +375,12 @@ describe('auctionmanager.js', function () {
367
375
val : function ( bidResponse ) {
368
376
return bidResponse . meta . advertiserDomains [ 0 ] ;
369
377
}
378
+ } ,
379
+ {
380
+ key : CONSTANTS . TARGETING_KEYS . ACAT ,
381
+ val : function ( bidResponse ) {
382
+ return bidResponse . meta . primaryCatId ;
383
+ }
370
384
}
371
385
]
372
386
@@ -455,6 +469,24 @@ describe('auctionmanager.js', function () {
455
469
assert . deepEqual ( response , expected ) ;
456
470
} ) ;
457
471
472
+ it ( 'Should set targeting as expecting when pbs is enabled' , function ( ) {
473
+ config . setConfig ( {
474
+ s2sConfig : {
475
+ accountId : '1' ,
476
+ enabled : true ,
477
+ defaultVendor : 'appnexus' ,
478
+ bidders : [ 'appnexus' ] ,
479
+ timeout : 1000 ,
480
+ adapter : 'prebidServer'
481
+ }
482
+ } ) ;
483
+
484
+ $$PREBID_GLOBAL$$ . bidderSettings = { } ;
485
+ let expected = getDefaultExpected ( bid ) ;
486
+ let response = getKeyValueTargetingPairs ( bid . bidderCode , bid ) ;
487
+ assert . deepEqual ( response , expected ) ;
488
+ } ) ;
489
+
458
490
it ( 'Custom bidCpmAdjustment for one bidder and inherit standard but doesn\'t use standard bidCpmAdjustment' , function ( ) {
459
491
$$PREBID_GLOBAL$$ . bidderSettings =
460
492
{
0 commit comments