prebid.js 8.7.0 → 8.8.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 (187) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -1
  3. package/dist/a1MediaRtdProvider.js +1 -1
  4. package/dist/adagioBidAdapter.js +1 -1
  5. package/dist/adbookpspBidAdapter.js +1 -1
  6. package/dist/adgenerationBidAdapter.js +1 -1
  7. package/dist/admaticBidAdapter.js +1 -1
  8. package/dist/adqueryBidAdapter.js +1 -1
  9. package/dist/adqueryIdSystem.js +1 -1
  10. package/dist/adrelevantisBidAdapter.js +1 -1
  11. package/dist/adtrgtmeBidAdapter.js +1 -1
  12. package/dist/adxcgBidAdapter.js +1 -1
  13. package/dist/adyoulikeBidAdapter.js +1 -1
  14. package/dist/ajaBidAdapter.js +1 -1
  15. package/dist/amxBidAdapter.js +1 -1
  16. package/dist/amxIdSystem.js +1 -1
  17. package/dist/appierAnalyticsAdapter.js +1 -1
  18. package/dist/appnexusBidAdapter.js +1 -1
  19. package/dist/asoBidAdapter.js +1 -1
  20. package/dist/axonixBidAdapter.js +1 -1
  21. package/dist/bidViewability.js +1 -1
  22. package/dist/bidglassBidAdapter.js +1 -1
  23. package/dist/big-richmediaBidAdapter.js +1 -1
  24. package/dist/brandmetricsRtdProvider.js +1 -1
  25. package/dist/bridBidAdapter.js +1 -1
  26. package/dist/bridgewellBidAdapter.js +1 -1
  27. package/dist/brightMountainMediaBidAdapter.js +1 -1
  28. package/dist/carodaBidAdapter.js +1 -1
  29. package/dist/chtnwBidAdapter.js +1 -1
  30. package/dist/concertBidAdapter.js +1 -1
  31. package/dist/connectadBidAdapter.js +1 -1
  32. package/dist/consumableBidAdapter.js +1 -1
  33. package/dist/conversantAnalyticsAdapter.js +1 -1
  34. package/dist/conversantBidAdapter.js +1 -1
  35. package/dist/craftBidAdapter.js +1 -1
  36. package/dist/criteoBidAdapter.js +1 -1
  37. package/dist/cwireBidAdapter.js +1 -1
  38. package/dist/dependencies.json +4 -1
  39. package/dist/dspxBidAdapter.js +1 -1
  40. package/dist/eplanningBidAdapter.js +1 -1
  41. package/dist/euidIdSystem.js +1 -1
  42. package/dist/feedadBidAdapter.js +1 -1
  43. package/dist/finativeBidAdapter.js +1 -1
  44. package/dist/freewheel-sspBidAdapter.js +1 -1
  45. package/dist/geoedgeRtdProvider.js +1 -1
  46. package/dist/gmosspBidAdapter.js +1 -1
  47. package/dist/goldbachBidAdapter.js +1 -1
  48. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  49. package/dist/greenbidsRtdProvider.js +1 -1
  50. package/dist/gridBidAdapter.js +1 -1
  51. package/dist/gumgumBidAdapter.js +1 -1
  52. package/dist/h12mediaBidAdapter.js +1 -1
  53. package/dist/hypelabBidAdapter.js +1 -1
  54. package/dist/id5IdSystem.js +1 -1
  55. package/dist/imdsBidAdapter.js +1 -1
  56. package/dist/improvedigitalBidAdapter.js +1 -1
  57. package/dist/insticatorBidAdapter.js +1 -1
  58. package/dist/ixBidAdapter.js +1 -1
  59. package/dist/justpremiumBidAdapter.js +1 -1
  60. package/dist/kargoBidAdapter.js +1 -1
  61. package/dist/konduitAnalyticsAdapter.js +1 -1
  62. package/dist/kueezBidAdapter.js +1 -1
  63. package/dist/kueezRtbBidAdapter.js +1 -1
  64. package/dist/kulturemediaBidAdapter.js +1 -1
  65. package/dist/lassoBidAdapter.js +1 -1
  66. package/dist/lifestreetBidAdapter.js +1 -1
  67. package/dist/liveIntentIdSystem.js +1 -1
  68. package/dist/logicadBidAdapter.js +1 -1
  69. package/dist/loglyliftBidAdapter.js +1 -1
  70. package/dist/magniteAnalyticsAdapter.js +1 -1
  71. package/dist/malltvAnalyticsAdapter.js +1 -1
  72. package/dist/marsmediaBidAdapter.js +1 -1
  73. package/dist/mediafuseBidAdapter.js +1 -1
  74. package/dist/mediasquareBidAdapter.js +1 -1
  75. package/dist/mgidBidAdapter.js +1 -1
  76. package/dist/minutemediaBidAdapter.js +1 -1
  77. package/dist/minutemediaplusBidAdapter.js +1 -1
  78. package/dist/nativoBidAdapter.js +1 -1
  79. package/dist/nexx360BidAdapter.js +1 -1
  80. package/dist/not-for-prod/prebid.js +138 -137
  81. package/dist/oguryBidAdapter.js +1 -1
  82. package/dist/onetagBidAdapter.js +1 -1
  83. package/dist/ooloAnalyticsAdapter.js +1 -1
  84. package/dist/operaadsBidAdapter.js +1 -1
  85. package/dist/operaadsIdSystem.js +1 -0
  86. package/dist/optidigitalBidAdapter.js +1 -1
  87. package/dist/outbrainBidAdapter.js +1 -1
  88. package/dist/oxxionAnalyticsAdapter.js +1 -1
  89. package/dist/parrableIdSystem.js +1 -1
  90. package/dist/pixfutureBidAdapter.js +1 -1
  91. package/dist/prebid-core.js +1 -1
  92. package/dist/publinkIdSystem.js +1 -1
  93. package/dist/pubmaticBidAdapter.js +1 -1
  94. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  95. package/dist/pxyzBidAdapter.js +1 -1
  96. package/dist/quantcastBidAdapter.js +1 -1
  97. package/dist/readpeakBidAdapter.js +1 -1
  98. package/dist/relaidoBidAdapter.js +1 -1
  99. package/dist/retailspotBidAdapter.js +1 -1
  100. package/dist/rhythmoneBidAdapter.js +1 -1
  101. package/dist/riseBidAdapter.js +1 -1
  102. package/dist/rubiconBidAdapter.js +1 -1
  103. package/dist/seedingAllianceBidAdapter.js +1 -1
  104. package/dist/seedtagBidAdapter.js +1 -1
  105. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  106. package/dist/sharethroughBidAdapter.js +1 -1
  107. package/dist/shinezBidAdapter.js +1 -1
  108. package/dist/smaatoBidAdapter.js +1 -1
  109. package/dist/smartadserverBidAdapter.js +1 -1
  110. package/dist/smartxBidAdapter.js +1 -1
  111. package/dist/smartyadsBidAdapter.js +1 -1
  112. package/dist/smilewantedBidAdapter.js +1 -1
  113. package/dist/snigelBidAdapter.js +1 -1
  114. package/dist/sonobiBidAdapter.js +1 -1
  115. package/dist/sovrnAnalyticsAdapter.js +1 -1
  116. package/dist/sovrnBidAdapter.js +1 -1
  117. package/dist/sspBCBidAdapter.js +1 -1
  118. package/dist/stvBidAdapter.js +1 -1
  119. package/dist/sublimeBidAdapter.js +1 -1
  120. package/dist/targetVideoBidAdapter.js +1 -1
  121. package/dist/teadsBidAdapter.js +1 -1
  122. package/dist/topicsFpdModule.js +1 -1
  123. package/dist/trionBidAdapter.js +1 -1
  124. package/dist/tripleliftBidAdapter.js +1 -1
  125. package/dist/ttdBidAdapter.js +1 -1
  126. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  127. package/dist/uid2IdSystem.js +1 -1
  128. package/dist/underdogmediaBidAdapter.js +1 -1
  129. package/dist/undertoneBidAdapter.js +1 -1
  130. package/dist/vidazooBidAdapter.js +1 -1
  131. package/dist/videobyteBidAdapter.js +1 -1
  132. package/dist/visxBidAdapter.js +1 -1
  133. package/dist/vuukleBidAdapter.js +1 -1
  134. package/dist/widespaceBidAdapter.js +1 -1
  135. package/dist/winrBidAdapter.js +1 -1
  136. package/dist/yahoosspBidAdapter.js +1 -1
  137. package/dist/yieldmoBidAdapter.js +1 -1
  138. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  139. package/integrationExamples/topics/topics-server.js +72 -0
  140. package/modules/.submodules.json +2 -1
  141. package/modules/a1MediaRtdProvider.js +1 -1
  142. package/modules/admaticBidAdapter.js +5 -0
  143. package/modules/adqueryBidAdapter.js +23 -21
  144. package/modules/adqueryIdSystem.js +45 -30
  145. package/modules/adrelevantisBidAdapter.js +2 -0
  146. package/modules/bidViewability.js +7 -0
  147. package/modules/bidViewability.md +9 -8
  148. package/modules/brandmetricsRtdProvider.js +30 -27
  149. package/modules/criteoBidAdapter.js +66 -43
  150. package/modules/geoedgeRtdProvider.js +43 -13
  151. package/modules/geoedgeRtdProvider.md +2 -1
  152. package/modules/liveIntentIdSystem.js +16 -1
  153. package/modules/nativoBidAdapter.js +21 -3
  154. package/modules/onetagBidAdapter.js +3 -0
  155. package/modules/operaadsBidAdapter.js +5 -0
  156. package/modules/operaadsBidAdapter.md +5 -5
  157. package/modules/operaadsIdSystem.js +106 -0
  158. package/modules/operaadsIdSystem.md +52 -0
  159. package/modules/oxxionAnalyticsAdapter.js +22 -5
  160. package/modules/rubiconBidAdapter.js +2 -2
  161. package/modules/smartyadsBidAdapter.js +18 -1
  162. package/modules/snigelBidAdapter.js +69 -16
  163. package/modules/snigelBidAdapter.md +9 -3
  164. package/modules/topicsFpdModule.js +35 -9
  165. package/modules/visxBidAdapter.js +51 -1
  166. package/package.json +2 -2
  167. package/src/adloader.js +1 -0
  168. package/src/native.js +2 -2
  169. package/test/spec/modules/admaticBidAdapter_spec.js +5 -0
  170. package/test/spec/modules/adqueryIdSystem_spec.js +13 -24
  171. package/test/spec/modules/bidViewability_spec.js +32 -1
  172. package/test/spec/modules/brandmetricsRtdProvider_spec.js +6 -0
  173. package/test/spec/modules/criteoBidAdapter_spec.js +228 -0
  174. package/test/spec/modules/eids_spec.js +48 -0
  175. package/test/spec/modules/geoedgeRtdProvider_spec.js +44 -24
  176. package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +5 -0
  177. package/test/spec/modules/liveIntentIdSystem_spec.js +5 -0
  178. package/test/spec/modules/nativoBidAdapter_spec.js +6 -1
  179. package/test/spec/modules/onetagBidAdapter_spec.js +69 -0
  180. package/test/spec/modules/operaadsIdSystem_spec.js +53 -0
  181. package/test/spec/modules/oxxionAnalyticsAdapter_spec.js +6 -1
  182. package/test/spec/modules/rubiconBidAdapter_spec.js +24 -0
  183. package/test/spec/modules/smartyadsBidAdapter_spec.js +49 -0
  184. package/test/spec/modules/snigelBidAdapter_spec.js +57 -6
  185. package/test/spec/modules/topicsFpdModule_spec.js +102 -1
  186. package/test/spec/modules/visxBidAdapter_spec.js +151 -1
  187. package/test/spec/native_spec.js +5 -3
@@ -8,9 +8,9 @@ import {
8
8
  reset,
9
9
  topicStorageName
10
10
  } from '../../../modules/topicsFpdModule.js';
11
+ import {config} from 'src/config.js';
11
12
  import {deepClone, safeJSONParse} from '../../../src/utils.js';
12
13
  import {getCoreStorageManager} from 'src/storageManager.js';
13
- import {config} from 'src/config.js';
14
14
  import * as activities from '../../../src/activities/rules.js';
15
15
  import {ACTIVITY_ENRICH_UFPD} from '../../../src/activities/activities.js';
16
16
 
@@ -414,3 +414,104 @@ describe('topics', () => {
414
414
  });
415
415
  });
416
416
  });
417
+
418
+ describe('handles fetch request for topics api headers', () => {
419
+ let stubbedFetch;
420
+ const storage = getCoreStorageManager('topicsFpd');
421
+
422
+ beforeEach(() => {
423
+ stubbedFetch = sinon.stub(window, 'fetch');
424
+ });
425
+
426
+ afterEach(() => {
427
+ stubbedFetch.restore();
428
+ storage.removeDataFromLocalStorage(topicStorageName);
429
+ });
430
+
431
+ it('should make a fetch call when a fetchUrl is present for a selected bidder', () => {
432
+ config.setConfig({
433
+ userSync: {
434
+ topics: {
435
+ maxTopicCaller: 3,
436
+ bidders: [
437
+ {
438
+ bidder: 'pubmatic',
439
+ fetchUrl: 'http://localhost:3000/topics-server.js'
440
+ }
441
+ ],
442
+ },
443
+ }
444
+ });
445
+
446
+ stubbedFetch.returns(Promise.resolve(true));
447
+ loadTopicsForBidders({
448
+ browsingTopics: true,
449
+ featurePolicy: {
450
+ allowsFeature() { return true }
451
+ }
452
+ });
453
+ sinon.assert.calledOnce(stubbedFetch);
454
+ stubbedFetch.calledWith('http://localhost:3000/topics-server.js');
455
+ });
456
+
457
+ it('should not make a fetch call when a fetchUrl is not present for a selected bidder', () => {
458
+ config.setConfig({
459
+ userSync: {
460
+ topics: {
461
+ maxTopicCaller: 3,
462
+ bidders: [
463
+ {
464
+ bidder: 'pubmatic'
465
+ }
466
+ ],
467
+ },
468
+ }
469
+ });
470
+
471
+ loadTopicsForBidders({
472
+ browsingTopics: true,
473
+ featurePolicy: {
474
+ allowsFeature() { return true }
475
+ }
476
+ });
477
+ sinon.assert.notCalled(stubbedFetch);
478
+ });
479
+
480
+ it('a fetch request should not be made if the configured fetch rate duration has not yet passed', () => {
481
+ const storedSegments = JSON.stringify(
482
+ [['pubmatic', {
483
+ '2206021246': {
484
+ 'ext': {'segtax': 600, 'segclass': '2206021246'},
485
+ 'segment': [{'id': '243'}, {'id': '265'}],
486
+ 'name': 'ads.pubmatic.com'
487
+ },
488
+ 'lastUpdated': new Date().getTime()
489
+ }]]
490
+ );
491
+
492
+ storage.setDataInLocalStorage(topicStorageName, storedSegments);
493
+
494
+ config.setConfig({
495
+ userSync: {
496
+ topics: {
497
+ maxTopicCaller: 3,
498
+ bidders: [
499
+ {
500
+ bidder: 'pubmatic',
501
+ fetchUrl: 'http://localhost:3000/topics-server.js',
502
+ fetchRate: 1 // in days. 1 fetch per day
503
+ }
504
+ ],
505
+ },
506
+ }
507
+ });
508
+
509
+ loadTopicsForBidders({
510
+ browsingTopics: true,
511
+ featurePolicy: {
512
+ allowsFeature() { return true }
513
+ }
514
+ });
515
+ sinon.assert.notCalled(stubbedFetch);
516
+ });
517
+ });
@@ -1,5 +1,5 @@
1
1
  import { expect } from 'chai';
2
- import { spec } from 'modules/visxBidAdapter.js';
2
+ import { spec, storage } from 'modules/visxBidAdapter.js';
3
3
  import { config } from 'src/config.js';
4
4
  import { newBidder } from 'src/adapters/bidderFactory.js';
5
5
  import * as utils from 'src/utils.js';
@@ -82,6 +82,9 @@ describe('VisxAdapter', function () {
82
82
  });
83
83
  return res;
84
84
  }
85
+
86
+ let cookiesAreEnabledStub, localStorageIsEnabledStub;
87
+
85
88
  const bidderRequest = {
86
89
  timeout: 3000,
87
90
  refererInfo: {
@@ -180,6 +183,24 @@ describe('VisxAdapter', function () {
180
183
  'ext': {'bidder': {'uid': 903537}}
181
184
  }];
182
185
 
186
+ before(() => {
187
+ $$PREBID_GLOBAL$$.bidderSettings = {
188
+ visx: {
189
+ storageAllowed: false
190
+ }
191
+ };
192
+ localStorageIsEnabledStub = sinon.stub(storage, 'localStorageIsEnabled');
193
+ cookiesAreEnabledStub = sinon.stub(storage, 'cookiesAreEnabled');
194
+ localStorageIsEnabledStub.returns(false);
195
+ cookiesAreEnabledStub.returns(false);
196
+ });
197
+
198
+ after(() => {
199
+ localStorageIsEnabledStub.restore();
200
+ cookiesAreEnabledStub.restore();
201
+ $$PREBID_GLOBAL$$.bidderSettings = {};
202
+ });
203
+
183
204
  it('should attach valid params to the tag', function () {
184
205
  const firstBid = bidRequests[0];
185
206
  const bids = [firstBid];
@@ -422,6 +443,7 @@ describe('VisxAdapter', function () {
422
443
  });
423
444
  return res;
424
445
  }
446
+ let cookiesAreEnabledStub, localStorageIsEnabledStub;
425
447
  const bidderRequest = {
426
448
  timeout: 3000,
427
449
  refererInfo: {
@@ -449,6 +471,24 @@ describe('VisxAdapter', function () {
449
471
  }
450
472
  ];
451
473
 
474
+ before(() => {
475
+ $$PREBID_GLOBAL$$.bidderSettings = {
476
+ visx: {
477
+ storageAllowed: false
478
+ }
479
+ };
480
+ localStorageIsEnabledStub = sinon.stub(storage, 'localStorageIsEnabled');
481
+ cookiesAreEnabledStub = sinon.stub(storage, 'cookiesAreEnabled');
482
+ localStorageIsEnabledStub.returns(false);
483
+ cookiesAreEnabledStub.returns(false);
484
+ });
485
+
486
+ after(() => {
487
+ localStorageIsEnabledStub.restore();
488
+ cookiesAreEnabledStub.restore();
489
+ $$PREBID_GLOBAL$$.bidderSettings = {};
490
+ });
491
+
452
492
  it('should send requst for banner bid', function () {
453
493
  const request = spec.buildRequests([bidRequests[0]], bidderRequest);
454
494
  const payload = parseRequest(request.url);
@@ -486,6 +526,7 @@ describe('VisxAdapter', function () {
486
526
  });
487
527
  return res;
488
528
  }
529
+ let cookiesAreEnabledStub, localStorageIsEnabledStub;
489
530
  const bidderRequest = {
490
531
  timeout: 3000,
491
532
  refererInfo: {
@@ -529,10 +570,23 @@ describe('VisxAdapter', function () {
529
570
  documentStub.withArgs('visx-adunit-element-2').returns({
530
571
  id: 'visx-adunit-element-2'
531
572
  });
573
+
574
+ $$PREBID_GLOBAL$$.bidderSettings = {
575
+ visx: {
576
+ storageAllowed: false
577
+ }
578
+ };
579
+ localStorageIsEnabledStub = sinon.stub(storage, 'localStorageIsEnabled');
580
+ cookiesAreEnabledStub = sinon.stub(storage, 'cookiesAreEnabled');
581
+ localStorageIsEnabledStub.returns(false);
582
+ cookiesAreEnabledStub.returns(false);
532
583
  });
533
584
 
534
585
  after(function() {
535
586
  sandbox.restore();
587
+ localStorageIsEnabledStub.restore();
588
+ cookiesAreEnabledStub.restore();
589
+ $$PREBID_GLOBAL$$.bidderSettings = {};
536
590
  });
537
591
 
538
592
  it('should find ad slot by ad unit code as element id', function () {
@@ -1323,4 +1377,100 @@ describe('VisxAdapter', function () {
1323
1377
  expect(query).to.deep.equal({});
1324
1378
  });
1325
1379
  });
1380
+
1381
+ describe('first party user id', function () {
1382
+ const USER_ID_KEY = '__vads';
1383
+ const USER_ID_DUMMY_VALUE_COOKIE = 'dummy_id_cookie';
1384
+ const USER_ID_DUMMY_VALUE_LOCAL_STORAGE = 'dummy_id_local_storage';
1385
+
1386
+ let getDataFromLocalStorageStub, localStorageIsEnabledStub;
1387
+ let getCookieStub, cookiesAreEnabledStub;
1388
+
1389
+ const bidRequests = [
1390
+ {
1391
+ 'bidder': 'visx',
1392
+ 'params': {
1393
+ 'uid': 903535
1394
+ },
1395
+ 'adUnitCode': 'adunit-code-1',
1396
+ 'sizes': [[300, 250], [300, 600]],
1397
+ 'bidId': '30b31c1838de1e',
1398
+ 'bidderRequestId': '22edbae2733bf6',
1399
+ 'auctionId': '1d1a030790a475',
1400
+ }
1401
+ ];
1402
+ const bidderRequest = {
1403
+ timeout: 3000,
1404
+ refererInfo: {
1405
+ page: 'https://example.com'
1406
+ }
1407
+ };
1408
+
1409
+ beforeEach(() => {
1410
+ $$PREBID_GLOBAL$$.bidderSettings = {
1411
+ visx: {
1412
+ storageAllowed: true
1413
+ }
1414
+ };
1415
+ cookiesAreEnabledStub = sinon.stub(storage, 'cookiesAreEnabled');
1416
+ localStorageIsEnabledStub = sinon.stub(storage, 'localStorageIsEnabled');
1417
+ });
1418
+
1419
+ afterEach(() => {
1420
+ cookiesAreEnabledStub.restore();
1421
+ localStorageIsEnabledStub.restore();
1422
+ getCookieStub && getCookieStub.restore();
1423
+ getDataFromLocalStorageStub && getDataFromLocalStorageStub.restore();
1424
+ $$PREBID_GLOBAL$$.bidderSettings = {};
1425
+ });
1426
+
1427
+ it('should not pass user id if both cookies and local storage are not available', function () {
1428
+ cookiesAreEnabledStub.returns(false);
1429
+ localStorageIsEnabledStub.returns(false);
1430
+
1431
+ const request = spec.buildRequests(bidRequests, bidderRequest);
1432
+
1433
+ expect(request.data.user).to.be.undefined;
1434
+ });
1435
+
1436
+ it('should get user id from cookie if available', function () {
1437
+ cookiesAreEnabledStub.returns(true);
1438
+ localStorageIsEnabledStub.returns(false);
1439
+ getCookieStub = sinon.stub(storage, 'getCookie');
1440
+ getCookieStub.withArgs(USER_ID_KEY).returns(USER_ID_DUMMY_VALUE_COOKIE);
1441
+
1442
+ const request = spec.buildRequests(bidRequests, bidderRequest);
1443
+
1444
+ expect(request.data.user.ext.vads).to.equal(USER_ID_DUMMY_VALUE_COOKIE);
1445
+ });
1446
+
1447
+ it('should get user id from local storage if available', function () {
1448
+ cookiesAreEnabledStub.returns(false);
1449
+ localStorageIsEnabledStub.returns(true);
1450
+ getDataFromLocalStorageStub = sinon.stub(storage, 'getDataFromLocalStorage');
1451
+ getDataFromLocalStorageStub.withArgs(USER_ID_KEY).returns(USER_ID_DUMMY_VALUE_LOCAL_STORAGE);
1452
+
1453
+ const request = spec.buildRequests(bidRequests, bidderRequest);
1454
+
1455
+ expect(request.data.user.ext.vads).to.equal(USER_ID_DUMMY_VALUE_LOCAL_STORAGE);
1456
+ });
1457
+
1458
+ it('should create user id and store it in cookies (if user id does not exist)', function () {
1459
+ cookiesAreEnabledStub.returns(true);
1460
+ localStorageIsEnabledStub.returns(false);
1461
+
1462
+ const request = spec.buildRequests(bidRequests, bidderRequest);
1463
+ expect(storage.getCookie(USER_ID_KEY)).to.be.a('string');
1464
+ expect(request.data.user.ext.vads).to.be.a('string');
1465
+ });
1466
+
1467
+ it('should create user id and store it in local storage (if user id does not exist)', function () {
1468
+ cookiesAreEnabledStub.returns(false);
1469
+ localStorageIsEnabledStub.returns(true);
1470
+
1471
+ const request = spec.buildRequests(bidRequests, bidderRequest);
1472
+ expect(storage.getDataFromLocalStorage(USER_ID_KEY)).to.be.a('string');
1473
+ expect(request.data.user.ext.vads).to.be.a('string');
1474
+ });
1475
+ });
1326
1476
  });
@@ -631,7 +631,8 @@ describe('native.js', function () {
631
631
  eventtrackers: [
632
632
  { event: 1, method: 1, url: 'https://sampleurl.com' },
633
633
  { event: 1, method: 2, url: 'https://sampleurljs.com' }
634
- ]
634
+ ],
635
+ imptrackers: [ 'https://sample-imp.com' ]
635
636
  }
636
637
  describe('toLegacyResponse', () => {
637
638
  it('returns assets in legacy format for ortb responses', () => {
@@ -640,8 +641,9 @@ describe('native.js', function () {
640
641
  expect(actual.title).to.equal('vtitle');
641
642
  expect(actual.clickUrl).to.equal('url');
642
643
  expect(actual.javascriptTrackers).to.equal('<script async src="https://sampleurljs.com"></script>');
643
- expect(actual.impressionTrackers.length).to.equal(1);
644
- expect(actual.impressionTrackers[0]).to.equal('https://sampleurl.com');
644
+ expect(actual.impressionTrackers.length).to.equal(2);
645
+ expect(actual.impressionTrackers).to.contain('https://sampleurl.com');
646
+ expect(actual.impressionTrackers).to.contain('https://sample-imp.com');
645
647
  });
646
648
  });
647
649
  });