prebid.js 5.19.0 → 5.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/modules/airgridRtdProvider.js +1 -1
  2. package/modules/appnexusBidAdapter.js +5 -3
  3. package/modules/atsAnalyticsAdapter.js +67 -46
  4. package/modules/atsAnalyticsAdapter.md +1 -0
  5. package/modules/betweenBidAdapter.js +2 -1
  6. package/modules/browsiRtdProvider.js +106 -18
  7. package/modules/cleanioRtdProvider.js +192 -0
  8. package/modules/cleanioRtdProvider.md +59 -0
  9. package/modules/deltaprojectsBidAdapter.js +252 -0
  10. package/modules/deltaprojectsBidAdapter.md +32 -0
  11. package/modules/gridBidAdapter.js +1 -0
  12. package/modules/ixBidAdapter.js +7 -1
  13. package/modules/jixieBidAdapter.js +8 -2
  14. package/modules/justpremiumBidAdapter.js +6 -1
  15. package/modules/livewrappedAnalyticsAdapter.js +5 -0
  16. package/modules/multibid/index.js +3 -3
  17. package/modules/nativoBidAdapter.js +5 -1
  18. package/modules/openxBidAdapter.js +1 -1
  19. package/modules/operaadsBidAdapter.js +21 -1
  20. package/modules/otmBidAdapter.js +146 -0
  21. package/modules/otmBidAdapter.md +27 -26
  22. package/modules/outbrainBidAdapter.js +5 -0
  23. package/modules/playwireBidAdapter.md +61 -0
  24. package/modules/rtdModule/index.js +2 -2
  25. package/modules/sonobiBidAdapter.js +7 -0
  26. package/modules/sortableBidAdapter.js +1 -0
  27. package/modules/teadsBidAdapter.js +3 -0
  28. package/modules/trustxBidAdapter.js +8 -6
  29. package/modules/ventesBidAdapter.js +370 -0
  30. package/modules/ventesBidAdapter.md +94 -0
  31. package/modules/yahoosspBidAdapter.js +6 -6
  32. package/package.json +1 -1
  33. package/src/auction.js +11 -11
  34. package/test/spec/modules/appnexusBidAdapter_spec.js +2 -1
  35. package/test/spec/modules/atsAnalyticsAdapter_spec.js +42 -9
  36. package/test/spec/modules/browsiRtdProvider_spec.js +62 -7
  37. package/test/spec/modules/cleanioRtdProvider_spec.js +188 -0
  38. package/test/spec/modules/deltaprojectsBidAdapter_spec.js +399 -0
  39. package/test/spec/modules/ixBidAdapter_spec.js +3 -3
  40. package/test/spec/modules/jixieBidAdapter_spec.js +13 -11
  41. package/test/spec/modules/justpremiumBidAdapter_spec.js +9 -2
  42. package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +23 -4
  43. package/test/spec/modules/multibid_spec.js +31 -31
  44. package/test/spec/modules/openxBidAdapter_spec.js +0 -26
  45. package/test/spec/modules/operaadsBidAdapter_spec.js +38 -6
  46. package/test/spec/modules/otmBidAdapter_spec.js +67 -0
  47. package/test/spec/modules/outbrainBidAdapter_spec.js +18 -0
  48. package/test/spec/modules/sonobiBidAdapter_spec.js +34 -1
  49. package/test/spec/modules/sortableBidAdapter_spec.js +11 -0
  50. package/test/spec/modules/teadsBidAdapter_spec.js +132 -0
  51. package/test/spec/modules/trustxBidAdapter_spec.js +3 -3
  52. package/test/spec/modules/ventesBidAdapter_spec.js +845 -0
  53. package/test/spec/unit/core/adapterManager_spec.js +2 -1
@@ -82,7 +82,7 @@ describe('multibid adapter', function () {
82
82
  'sizes': [[300, 250]]
83
83
  }
84
84
  },
85
- 'adUnitCode': 'test-div',
85
+ 'adUnitCode': 'test.div',
86
86
  'transactionId': 'c153f3da-84f0-4be8-95cb-0647c458bc60',
87
87
  'sizes': [[300, 250]],
88
88
  'bidId': '2408ef83b84c9d',
@@ -106,7 +106,7 @@ describe('multibid adapter', function () {
106
106
  'sizes': [[300, 250]]
107
107
  }
108
108
  },
109
- 'adUnitCode': 'test-div',
109
+ 'adUnitCode': 'test.div',
110
110
  'transactionId': 'c153f3da-84f0-4be8-95cb-0647c458bc60',
111
111
  'sizes': [[300, 250]],
112
112
  'bidId': '2408ef83b84c9d',
@@ -197,14 +197,14 @@ describe('multibid adapter', function () {
197
197
  });
198
198
 
199
199
  it('adds original bids and does not modify', function () {
200
- let adUnitCode = 'test-div';
200
+ let adUnitCode = 'test.div';
201
201
  let bids = [{...bidArray[0]}, {...bidArray[1]}];
202
202
 
203
203
  addBidResponseHook(callbackFn, adUnitCode, {...bids[0]});
204
204
 
205
205
  expect(result).to.not.equal(null);
206
206
  expect(result.adUnitCode).to.not.equal(null);
207
- expect(result.adUnitCode).to.equal('test-div');
207
+ expect(result.adUnitCode).to.equal('test.div');
208
208
  expect(result.bid).to.not.equal(null);
209
209
  expect(result.bid).to.deep.equal(bids[0]);
210
210
 
@@ -214,13 +214,13 @@ describe('multibid adapter', function () {
214
214
 
215
215
  expect(result).to.not.equal(null);
216
216
  expect(result.adUnitCode).to.not.equal(null);
217
- expect(result.adUnitCode).to.equal('test-div');
217
+ expect(result.adUnitCode).to.equal('test.div');
218
218
  expect(result.bid).to.not.equal(null);
219
219
  expect(result.bid).to.deep.equal(bids[1]);
220
220
  });
221
221
 
222
222
  it('modifies and adds both bids based on multibid configuration', function () {
223
- let adUnitCode = 'test-div';
223
+ let adUnitCode = 'test.div';
224
224
  let bids = [{...bidArray[0]}, {...bidArray[1]}];
225
225
 
226
226
  config.setConfig({multibid: [{bidder: 'bidderA', maxBids: 2, targetBiddercodePrefix: 'bidA'}]});
@@ -232,7 +232,7 @@ describe('multibid adapter', function () {
232
232
 
233
233
  expect(result).to.not.equal(null);
234
234
  expect(result.adUnitCode).to.not.equal(null);
235
- expect(result.adUnitCode).to.equal('test-div');
235
+ expect(result.adUnitCode).to.equal('test.div');
236
236
  expect(result.bid).to.not.equal(null);
237
237
  expect(result.bid).to.deep.equal(bids[0]);
238
238
 
@@ -250,13 +250,13 @@ describe('multibid adapter', function () {
250
250
 
251
251
  expect(result).to.not.equal(null);
252
252
  expect(result.adUnitCode).to.not.equal(null);
253
- expect(result.adUnitCode).to.equal('test-div');
253
+ expect(result.adUnitCode).to.equal('test.div');
254
254
  expect(result.bid).to.not.equal(null);
255
255
  expect(result.bid).to.deep.equal(bids[1]);
256
256
  });
257
257
 
258
258
  it('only modifies bids defined in the multibid configuration', function () {
259
- let adUnitCode = 'test-div';
259
+ let adUnitCode = 'test.div';
260
260
  let bids = [{...bidArray[0]}, {...bidArray[1]}];
261
261
 
262
262
  bids.push({
@@ -276,7 +276,7 @@ describe('multibid adapter', function () {
276
276
 
277
277
  expect(result).to.not.equal(null);
278
278
  expect(result.adUnitCode).to.not.equal(null);
279
- expect(result.adUnitCode).to.equal('test-div');
279
+ expect(result.adUnitCode).to.equal('test.div');
280
280
  expect(result.bid).to.not.equal(null);
281
281
  expect(result.bid).to.deep.equal(bids[0]);
282
282
 
@@ -292,7 +292,7 @@ describe('multibid adapter', function () {
292
292
 
293
293
  expect(result).to.not.equal(null);
294
294
  expect(result.adUnitCode).to.not.equal(null);
295
- expect(result.adUnitCode).to.equal('test-div');
295
+ expect(result.adUnitCode).to.equal('test.div');
296
296
  expect(result.bid).to.not.equal(null);
297
297
  expect(result.bid).to.deep.equal(bids[1]);
298
298
 
@@ -302,13 +302,13 @@ describe('multibid adapter', function () {
302
302
 
303
303
  expect(result).to.not.equal(null);
304
304
  expect(result.adUnitCode).to.not.equal(null);
305
- expect(result.adUnitCode).to.equal('test-div');
305
+ expect(result.adUnitCode).to.equal('test.div');
306
306
  expect(result.bid).to.not.equal(null);
307
307
  expect(result.bid).to.deep.equal(bids[2]);
308
308
  });
309
309
 
310
310
  it('only modifies and returns bids under limit for a specifc bidder in the multibid configuration', function () {
311
- let adUnitCode = 'test-div';
311
+ let adUnitCode = 'test.div';
312
312
  let bids = [{...bidArray[0]}, {...bidArray[1]}];
313
313
 
314
314
  bids.push({
@@ -328,7 +328,7 @@ describe('multibid adapter', function () {
328
328
 
329
329
  expect(result).to.not.equal(null);
330
330
  expect(result.adUnitCode).to.not.equal(null);
331
- expect(result.adUnitCode).to.equal('test-div');
331
+ expect(result.adUnitCode).to.equal('test.div');
332
332
  expect(result.bid).to.not.equal(null);
333
333
  expect(result.bid).to.deep.equal(bids[0]);
334
334
 
@@ -344,7 +344,7 @@ describe('multibid adapter', function () {
344
344
 
345
345
  expect(result).to.not.equal(null);
346
346
  expect(result.adUnitCode).to.not.equal(null);
347
- expect(result.adUnitCode).to.equal('test-div');
347
+ expect(result.adUnitCode).to.equal('test.div');
348
348
  expect(result.bid).to.not.equal(null);
349
349
  expect(result.bid).to.deep.equal(bids[1]);
350
350
 
@@ -356,7 +356,7 @@ describe('multibid adapter', function () {
356
356
  });
357
357
 
358
358
  it('if no prefix in multibid configuration, modifies and returns bids under limit without preifx property', function () {
359
- let adUnitCode = 'test-div';
359
+ let adUnitCode = 'test.div';
360
360
  let bids = [{...bidArray[0]}, {...bidArray[1]}];
361
361
 
362
362
  bids.push({
@@ -375,7 +375,7 @@ describe('multibid adapter', function () {
375
375
 
376
376
  expect(result).to.not.equal(null);
377
377
  expect(result.adUnitCode).to.not.equal(null);
378
- expect(result.adUnitCode).to.equal('test-div');
378
+ expect(result.adUnitCode).to.equal('test.div');
379
379
  expect(result.bid).to.not.equal(null);
380
380
  expect(result.bid).to.deep.equal(bids[0]);
381
381
 
@@ -389,7 +389,7 @@ describe('multibid adapter', function () {
389
389
 
390
390
  expect(result).to.not.equal(null);
391
391
  expect(result.adUnitCode).to.not.equal(null);
392
- expect(result.adUnitCode).to.equal('test-div');
392
+ expect(result.adUnitCode).to.equal('test.div');
393
393
  expect(result.bid).to.not.equal(null);
394
394
  expect(result.bid).to.deep.equal(bids[1]);
395
395
 
@@ -401,7 +401,7 @@ describe('multibid adapter', function () {
401
401
  });
402
402
 
403
403
  it('does not include extra bids if cpm is less than floor value', function () {
404
- let adUnitCode = 'test-div';
404
+ let adUnitCode = 'test.div';
405
405
  let bids = [{...bidArrayAlt[1]}, {...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}];
406
406
 
407
407
  bids.map(bid => {
@@ -418,7 +418,7 @@ describe('multibid adapter', function () {
418
418
  floorRuleValue: 65,
419
419
  floorValue: 65,
420
420
  matchedFields: {
421
- gptSlot: 'test-div',
421
+ gptSlot: 'test.div',
422
422
  mediaType: 'banner'
423
423
  }
424
424
  }
@@ -435,7 +435,7 @@ describe('multibid adapter', function () {
435
435
 
436
436
  expect(result).to.not.equal(null);
437
437
  expect(result.adUnitCode).to.not.equal(null);
438
- expect(result.adUnitCode).to.equal('test-div');
438
+ expect(result.adUnitCode).to.equal('test.div');
439
439
  expect(result.bid).to.not.equal(null);
440
440
  expect(result.bid.bidder).to.equal('bidderA');
441
441
  expect(result.bid.targetingBidder).to.equal(undefined);
@@ -452,7 +452,7 @@ describe('multibid adapter', function () {
452
452
 
453
453
  expect(result).to.not.equal(null);
454
454
  expect(result.adUnitCode).to.not.equal(null);
455
- expect(result.adUnitCode).to.equal('test-div');
455
+ expect(result.adUnitCode).to.equal('test.div');
456
456
  expect(result.bid).to.not.equal(null);
457
457
  expect(result.bid.bidder).to.equal('bidderB');
458
458
  expect(result.bid.targetingBidder).to.equal(undefined);
@@ -463,14 +463,14 @@ describe('multibid adapter', function () {
463
463
 
464
464
  expect(result).to.not.equal(null);
465
465
  expect(result.adUnitCode).to.not.equal(null);
466
- expect(result.adUnitCode).to.equal('test-div');
466
+ expect(result.adUnitCode).to.equal('test.div');
467
467
  expect(result.bid).to.not.equal(null);
468
468
  expect(result.bid.bidder).to.equal('bidderC');
469
469
  expect(result.bid.targetingBidder).to.equal(undefined);
470
470
  });
471
471
 
472
472
  it('does include extra bids if cpm is not less than floor value', function () {
473
- let adUnitCode = 'test-div';
473
+ let adUnitCode = 'test.div';
474
474
  let bids = [{...bidArrayAlt[1]}, {...bidArrayAlt[0]}];
475
475
 
476
476
  bids.map(bid => {
@@ -487,7 +487,7 @@ describe('multibid adapter', function () {
487
487
  floorRuleValue: 25,
488
488
  floorValue: 25,
489
489
  matchedFields: {
490
- gptSlot: 'test-div',
490
+ gptSlot: 'test.div',
491
491
  mediaType: 'banner'
492
492
  }
493
493
  }
@@ -504,7 +504,7 @@ describe('multibid adapter', function () {
504
504
 
505
505
  expect(result).to.not.equal(null);
506
506
  expect(result.adUnitCode).to.not.equal(null);
507
- expect(result.adUnitCode).to.equal('test-div');
507
+ expect(result.adUnitCode).to.equal('test.div');
508
508
  expect(result.bid).to.not.equal(null);
509
509
  expect(result.bid.bidder).to.equal('bidderA');
510
510
  expect(result.bid.targetingBidder).to.equal(undefined);
@@ -518,7 +518,7 @@ describe('multibid adapter', function () {
518
518
 
519
519
  expect(result).to.not.equal(null);
520
520
  expect(result.adUnitCode).to.not.equal(null);
521
- expect(result.adUnitCode).to.equal('test-div');
521
+ expect(result.adUnitCode).to.equal('test.div');
522
522
  expect(result.bid).to.not.equal(null);
523
523
  expect(result.bid.bidder).to.equal('bidderA');
524
524
  expect(result.bid.targetingBidder).to.equal('bidA2');
@@ -578,7 +578,7 @@ describe('multibid adapter', function () {
578
578
 
579
579
  it('it sorts and creates dynamic alias on bidsReceived if multibid configuration found with prefix', function () {
580
580
  let modifiedBids = [{...bidArray[1]}, {...bidArray[0]}].map(bid => {
581
- addBidResponseHook(bidResponseCallback, 'test-div', {...bid});
581
+ addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
582
582
 
583
583
  return bidResult;
584
584
  });
@@ -603,7 +603,7 @@ describe('multibid adapter', function () {
603
603
 
604
604
  it('it sorts by cpm treating dynamic alias as unique bid when no bid limit defined', function () {
605
605
  let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => {
606
- addBidResponseHook(bidResponseCallback, 'test-div', {...bid});
606
+ addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
607
607
 
608
608
  return bidResult;
609
609
  });
@@ -636,7 +636,7 @@ describe('multibid adapter', function () {
636
636
 
637
637
  it('it should filter out dynamic bid when bid limit is less than unique bid pool', function () {
638
638
  let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => {
639
- addBidResponseHook(bidResponseCallback, 'test-div', {...bid});
639
+ addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
640
640
 
641
641
  return bidResult;
642
642
  });
@@ -662,7 +662,7 @@ describe('multibid adapter', function () {
662
662
  config.setConfig({ multibid: [{bidder: 'bidderA', maxBids: 2, targetBiddercodePrefix: 'bidA'}] });
663
663
 
664
664
  let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => {
665
- addBidResponseHook(bidResponseCallback, 'test-div', {...bid});
665
+ addBidResponseHook(bidResponseCallback, 'test.div', {...bid});
666
666
 
667
667
  return bidResult;
668
668
  });
@@ -1602,32 +1602,6 @@ describe('OpenxAdapter', function () {
1602
1602
  scsm: 'dmp3/5:foo2|bar2,dmp4:baz2'
1603
1603
  },
1604
1604
  },
1605
- {
1606
- name: 'should not send duplicate proprietary segment data from first party config ',
1607
- config: {
1608
- ortb2: {
1609
- user: {
1610
- data: [
1611
- {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}, {id: 'foo'}]},
1612
- {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}]},
1613
- ]
1614
- },
1615
- site: {
1616
- content: {
1617
- data: [
1618
- {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}]},
1619
- {name: 'dmp3', ext: {segtax: 5}, segment: [{id: 'foo2'}, {id: 'foo2'}, {id: 'bar2'}]},
1620
- {name: 'dmp3', ext: {segtax: 5}, segment: [{id: 'foo2'}, {id: 'bar2'}]},
1621
- ]
1622
- }
1623
- }
1624
- }
1625
- },
1626
- expect: {
1627
- sm: 'dmp1/4:foo|bar',
1628
- scsm: 'dmp1/4:foo|bar,dmp3/5:foo2|bar2'
1629
- },
1630
- },
1631
1605
  {
1632
1606
  name: 'should combine same provider segment data from ortb2.user.data',
1633
1607
  config: {
@@ -369,7 +369,7 @@ describe('Opera Ads Bid Adapter', function () {
369
369
  requestData = JSON.parse(reqs[0].data);
370
370
  }).to.not.throw();
371
371
 
372
- expect(requestData.user.id).to.equal(bidRequests[0].userId.sharedid.id);
372
+ expect(requestData.user.buyeruid).to.equal(bidRequests[0].userId.sharedid.id);
373
373
  });
374
374
 
375
375
  it('pubcid should be used when sharedid is empty', function () {
@@ -406,7 +406,7 @@ describe('Opera Ads Bid Adapter', function () {
406
406
  requestData = JSON.parse(reqs[0].data);
407
407
  }).to.not.throw();
408
408
 
409
- expect(requestData.user.id).to.equal(bidRequests[0].userId.pubcid);
409
+ expect(requestData.user.buyeruid).to.equal(bidRequests[0].userId.pubcid);
410
410
  });
411
411
 
412
412
  it('random uid will be generate when userId is empty', function () {
@@ -433,7 +433,7 @@ describe('Opera Ads Bid Adapter', function () {
433
433
  requestData = JSON.parse(reqs[0].data);
434
434
  }).to.not.throw();
435
435
 
436
- expect(requestData.user.id).to.not.be.empty;
436
+ expect(requestData.user.buyeruid).to.not.be.empty;
437
437
  })
438
438
  });
439
439
 
@@ -679,9 +679,41 @@ describe('Opera Ads Bid Adapter', function () {
679
679
  });
680
680
  });
681
681
 
682
- describe('Test getUserSyncs', function () {
683
- it('getUserSyncs should return empty array', function () {
684
- expect(spec.getUserSyncs()).to.be.an('array').that.is.empty;
682
+ describe('Test getUserSyncs with both iframe and pixel disabled', function () {
683
+ it('getUserSyncs should return an empty array', function () {
684
+ const syncOptions = {};
685
+ expect(spec.getUserSyncs(syncOptions)).to.be.an('array').that.is.empty;
686
+ });
687
+ });
688
+
689
+ describe('Test getUserSyncs with iframe enabled', function () {
690
+ it('getUserSyncs should return array', function () {
691
+ const syncOptions = {
692
+ iframeEnabled: true
693
+ }
694
+ const userSyncPixels = spec.getUserSyncs(syncOptions)
695
+ expect(userSyncPixels).to.have.lengthOf(1);
696
+ expect(userSyncPixels[0].url).to.equal('https://s.adx.opera.com/usersync/page')
697
+ });
698
+ });
699
+
700
+ describe('Test getUserSyncs with pixel enabled', function () {
701
+ it('getUserSyncs should return array', function () {
702
+ const serverResponse = {
703
+ body: {
704
+ 'pixels': [
705
+ 'https://b1.com/usersync',
706
+ 'https://b2.com/usersync'
707
+ ]
708
+ }
709
+ };
710
+ const syncOptions = {
711
+ pixelEnabled: true
712
+ }
713
+ const userSyncPixels = spec.getUserSyncs(syncOptions, [serverResponse])
714
+ expect(userSyncPixels).to.have.lengthOf(2);
715
+ expect(userSyncPixels[0].url).to.equal('https://b1.com/usersync')
716
+ expect(userSyncPixels[1].url).to.equal('https://b2.com/usersync')
685
717
  });
686
718
  });
687
719
 
@@ -0,0 +1,67 @@
1
+ import {expect} from 'chai';
2
+ import {spec} from 'modules/otmBidAdapter';
3
+
4
+ describe('otmBidAdapter', function () {
5
+ it('validate_pub_params', function () {
6
+ expect(spec.isBidRequestValid({
7
+ bidder: 'otm',
8
+ params: {
9
+ tid: '123',
10
+ bidfloor: 20
11
+ }
12
+ })).to.equal(true);
13
+ });
14
+
15
+ it('validate_generated_params', function () {
16
+ let bidRequestData = [{
17
+ bidId: 'bid1234',
18
+ bidder: 'otm',
19
+ params: {
20
+ tid: '123',
21
+ bidfloor: 20
22
+ },
23
+ sizes: [[240, 400]]
24
+ }];
25
+
26
+ let request = spec.buildRequests(bidRequestData);
27
+ let req_data = request[0].data;
28
+
29
+ expect(req_data.bidid).to.equal('bid1234');
30
+ });
31
+
32
+ it('validate_response_params', function () {
33
+ let bidRequestData = {
34
+ data: {
35
+ bidId: 'bid1234'
36
+ }
37
+ };
38
+
39
+ let serverResponse = {
40
+ body: [
41
+ {
42
+ 'auctionid': '3c6f8e22-541b-485c-9214-e974d9fb1b6f',
43
+ 'cpm': 847.097,
44
+ 'ad': '<html><body>test html</body></html>',
45
+ 'w': 240,
46
+ 'h': 400,
47
+ 'currency': 'RUB',
48
+ 'ttl': 300,
49
+ 'creativeid': '1_7869053',
50
+ 'bidid': '101f211def7c99',
51
+ 'transactionid': 'transaction_id_1'
52
+ }
53
+ ]
54
+ };
55
+
56
+ let bids = spec.interpretResponse(serverResponse, bidRequestData);
57
+ expect(bids).to.have.lengthOf(1);
58
+ let bid = bids[0];
59
+ expect(bid.cpm).to.equal(847.097);
60
+ expect(bid.currency).to.equal('RUB');
61
+ expect(bid.width).to.equal(240);
62
+ expect(bid.height).to.equal(400);
63
+ expect(bid.netRevenue).to.equal(true);
64
+ expect(bid.requestId).to.equal('101f211def7c99');
65
+ expect(bid.ad).to.equal('<html><body>test html</body></html>');
66
+ });
67
+ });
@@ -2,6 +2,7 @@ import {expect} from 'chai';
2
2
  import {spec} from 'modules/outbrainBidAdapter.js';
3
3
  import {config} from 'src/config.js';
4
4
  import {server} from 'test/mocks/xhr';
5
+ import { createEidsArray } from 'modules/userId/eids.js';
5
6
 
6
7
  describe('Outbrain Adapter', function () {
7
8
  describe('Bid request and response', function () {
@@ -344,6 +345,23 @@ describe('Outbrain Adapter', function () {
344
345
 
345
346
  config.resetConfig()
346
347
  });
348
+
349
+ it('should pass extended ids', function () {
350
+ let bidRequest = {
351
+ bidId: 'bidId',
352
+ params: {},
353
+ userIdAsEids: createEidsArray({
354
+ idl_env: 'id-value',
355
+ }),
356
+ ...commonBidRequest,
357
+ };
358
+
359
+ let res = spec.buildRequests([bidRequest], commonBidderRequest);
360
+ const resData = JSON.parse(res.data)
361
+ expect(resData.user.ext.eids).to.deep.equal([
362
+ {source: 'liveramp.com', uids: [{id: 'id-value', atype: 3}]}
363
+ ]);
364
+ });
347
365
  })
348
366
 
349
367
  describe('interpretResponse', function () {
@@ -238,14 +238,17 @@ describe('SonobiBidAdapter', function () {
238
238
  });
239
239
 
240
240
  describe('.buildRequests', function () {
241
+ let sandbox;
241
242
  beforeEach(function() {
242
243
  sinon.stub(userSync, 'canBidderRegisterSync');
243
244
  sinon.stub(utils, 'getGptSlotInfoForAdUnitCode')
244
- .onFirstCall().returns({gptSlot: '/123123/gpt_publisher/adunit-code-3', divId: 'adunit-code-3-div-id'})
245
+ .onFirstCall().returns({gptSlot: '/123123/gpt_publisher/adunit-code-3', divId: 'adunit-code-3-div-id'});
246
+ sandbox = sinon.createSandbox();
245
247
  });
246
248
  afterEach(function() {
247
249
  userSync.canBidderRegisterSync.restore();
248
250
  utils.getGptSlotInfoForAdUnitCode.restore();
251
+ sandbox.restore();
249
252
  });
250
253
  let bidRequest = [{
251
254
  'schain': {
@@ -333,6 +336,36 @@ describe('SonobiBidAdapter', function () {
333
336
  uspConsent: 'someCCPAString'
334
337
  };
335
338
 
339
+ it('should set fpd if there is any data in ortb2', function() {
340
+ const ortb2 = {
341
+ site: {
342
+ ext: {
343
+ data: {
344
+ pageType: 'article',
345
+ category: 'tools'
346
+ }
347
+ }
348
+ },
349
+ user: {
350
+ ext: {
351
+ data: {
352
+ registered: true,
353
+ interests: ['cars']
354
+ }
355
+ }
356
+ }
357
+ };
358
+
359
+ sandbox.stub(config, 'getConfig').callsFake(key => {
360
+ const config = {
361
+ ortb2: ortb2
362
+ };
363
+ return utils.deepAccess(config, key);
364
+ });
365
+ const bidRequests = spec.buildRequests(bidRequest, bidderRequests);
366
+ expect(bidRequests.data.fpd).to.equal(JSON.stringify(ortb2));
367
+ });
368
+
336
369
  it('should populate coppa as 1 if set in config', function () {
337
370
  config.setConfig({coppa: true});
338
371
  const bidRequests = spec.buildRequests(bidRequest, bidderRequests);
@@ -112,6 +112,13 @@ describe('sortableBidAdapter', function() {
112
112
  'key2': 'val2'
113
113
  }
114
114
  },
115
+ 'ortb2Imp': {
116
+ 'ext': {
117
+ 'data': {
118
+ 'pbadslot': 'abc/123'
119
+ }
120
+ }
121
+ },
115
122
  'sizes': [
116
123
  [300, 250]
117
124
  ],
@@ -176,6 +183,10 @@ describe('sortableBidAdapter', function() {
176
183
  expect(requestBody.imp[0].floor).to.equal(0.21);
177
184
  });
178
185
 
186
+ it('includes pbadslot in the bid request', function () {
187
+ expect(requestBody.imp[0].ext.gpid).to.equal('abc/123');
188
+ });
189
+
179
190
  it('sets domain and href correctly', function () {
180
191
  expect(requestBody.site.domain).to.equal('example.com');
181
192
  expect(requestBody.site.page).to.equal('http://example.com/page?param=val');