prebid.js 7.44.0 → 7.45.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 (254) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -1
  3. package/dist/acuityAdsBidAdapter.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/adrelevantisBidAdapter.js +1 -1
  8. package/dist/adtrgtmeBidAdapter.js +1 -1
  9. package/dist/adxcgBidAdapter.js +1 -1
  10. package/dist/adyoulikeBidAdapter.js +1 -1
  11. package/dist/ajaBidAdapter.js +1 -1
  12. package/dist/amxBidAdapter.js +1 -1
  13. package/dist/amxIdSystem.js +1 -1
  14. package/dist/appierAnalyticsAdapter.js +1 -1
  15. package/dist/appnexusBidAdapter.js +1 -1
  16. package/dist/appushBidAdapter.js +1 -1
  17. package/dist/asoBidAdapter.js +1 -1
  18. package/dist/axonixBidAdapter.js +1 -1
  19. package/dist/beyondmediaBidAdapter.js +1 -1
  20. package/dist/bidglassBidAdapter.js +1 -1
  21. package/dist/big-richmediaBidAdapter.js +1 -1
  22. package/dist/braveBidAdapter.js +1 -1
  23. package/dist/bridgewellBidAdapter.js +1 -1
  24. package/dist/brightMountainMediaBidAdapter.js +1 -1
  25. package/dist/brightcomBidAdapter.js +1 -1
  26. package/dist/brightcomSSPBidAdapter.js +1 -1
  27. package/dist/carodaBidAdapter.js +1 -1
  28. package/dist/chtnwBidAdapter.js +1 -1
  29. package/dist/coinzillaBidAdapter.js +1 -1
  30. package/dist/compassBidAdapter.js +1 -1
  31. package/dist/concertBidAdapter.js +1 -1
  32. package/dist/connectIdSystem.js +1 -1
  33. package/dist/connectadBidAdapter.js +1 -1
  34. package/dist/consumableBidAdapter.js +1 -1
  35. package/dist/contentexchangeBidAdapter.js +1 -1
  36. package/dist/conversantAnalyticsAdapter.js +1 -1
  37. package/dist/conversantBidAdapter.js +1 -1
  38. package/dist/craftBidAdapter.js +1 -1
  39. package/dist/criteoBidAdapter.js +1 -1
  40. package/dist/cwireBidAdapter.js +1 -1
  41. package/dist/dependencies.json +12 -0
  42. package/dist/domainOverrideToRootDomain.js +1 -0
  43. package/dist/dspxBidAdapter.js +1 -1
  44. package/dist/eplanningBidAdapter.js +1 -1
  45. package/dist/feedadBidAdapter.js +1 -1
  46. package/dist/finativeBidAdapter.js +1 -1
  47. package/dist/freewheel-sspBidAdapter.js +1 -1
  48. package/dist/glimpseBidAdapter.js +1 -1
  49. package/dist/globalsunBidAdapter.js +1 -1
  50. package/dist/gmosspBidAdapter.js +1 -1
  51. package/dist/goldbachBidAdapter.js +1 -1
  52. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  53. package/dist/gridBidAdapter.js +1 -1
  54. package/dist/gridNMBidAdapter.js +1 -1
  55. package/dist/growthCodeIdSystem.js +1 -1
  56. package/dist/gumgumBidAdapter.js +1 -1
  57. package/dist/h12mediaBidAdapter.js +1 -1
  58. package/dist/id5IdSystem.js +1 -1
  59. package/dist/improvedigitalBidAdapter.js +1 -1
  60. package/dist/inmarBidAdapter.js +1 -1
  61. package/dist/insticatorBidAdapter.js +1 -1
  62. package/dist/iqzoneBidAdapter.js +1 -1
  63. package/dist/ivsBidAdapter.js +1 -0
  64. package/dist/ixBidAdapter.js +1 -1
  65. package/dist/justpremiumBidAdapter.js +1 -1
  66. package/dist/jwplayerVideoProvider.js +1 -1
  67. package/dist/kargoBidAdapter.js +1 -1
  68. package/dist/koblerBidAdapter.js +1 -1
  69. package/dist/konduitAnalyticsAdapter.js +1 -1
  70. package/dist/kueezBidAdapter.js +1 -1
  71. package/dist/kueezRtbBidAdapter.js +1 -1
  72. package/dist/kulturemediaBidAdapter.js +1 -1
  73. package/dist/lassoBidAdapter.js +1 -1
  74. package/dist/lifestreetBidAdapter.js +1 -1
  75. package/dist/liveIntentIdSystem.js +1 -1
  76. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  77. package/dist/logicadBidAdapter.js +1 -1
  78. package/dist/loglyliftBidAdapter.js +1 -1
  79. package/dist/luponmediaBidAdapter.js +1 -1
  80. package/dist/magniteAnalyticsAdapter.js +1 -1
  81. package/dist/malltvAnalyticsAdapter.js +1 -1
  82. package/dist/marsmediaBidAdapter.js +1 -1
  83. package/dist/mathildeadsBidAdapter.js +1 -1
  84. package/dist/mediafuseBidAdapter.js +1 -1
  85. package/dist/medianetBidAdapter.js +1 -1
  86. package/dist/mediasquareBidAdapter.js +1 -1
  87. package/dist/mgidBidAdapter.js +1 -1
  88. package/dist/minutemediaBidAdapter.js +1 -1
  89. package/dist/minutemediaplusBidAdapter.js +1 -1
  90. package/dist/nexx360BidAdapter.js +1 -1
  91. package/dist/not-for-prod/prebid.js +158 -156
  92. package/dist/oguryBidAdapter.js +1 -1
  93. package/dist/onetagBidAdapter.js +1 -1
  94. package/dist/onomagicBidAdapter.js +1 -1
  95. package/dist/ooloAnalyticsAdapter.js +1 -1
  96. package/dist/openxBidAdapter.js +1 -1
  97. package/dist/openxOrtbBidAdapter.js +1 -1
  98. package/dist/operaadsBidAdapter.js +1 -1
  99. package/dist/optidigitalBidAdapter.js +1 -1
  100. package/dist/outbrainBidAdapter.js +1 -1
  101. package/dist/parrableIdSystem.js +1 -1
  102. package/dist/pixfutureBidAdapter.js +1 -1
  103. package/dist/prebid-core.js +1 -1
  104. package/dist/publinkIdSystem.js +1 -1
  105. package/dist/pubmaticBidAdapter.js +1 -1
  106. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  107. package/dist/pubxBidAdapter.js +1 -1
  108. package/dist/pxyzBidAdapter.js +1 -1
  109. package/dist/quantcastBidAdapter.js +1 -1
  110. package/dist/readpeakBidAdapter.js +1 -1
  111. package/dist/relaidoBidAdapter.js +1 -1
  112. package/dist/rhythmoneBidAdapter.js +1 -1
  113. package/dist/riseBidAdapter.js +1 -1
  114. package/dist/rubiconAnalyticsAdapter.js +1 -1
  115. package/dist/rubiconBidAdapter.js +1 -1
  116. package/dist/seedingAllianceBidAdapter.js +1 -1
  117. package/dist/seedtagBidAdapter.js +1 -1
  118. package/dist/sharedIdSystem.js +1 -1
  119. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  120. package/dist/sharethroughBidAdapter.js +1 -1
  121. package/dist/shinezBidAdapter.js +1 -1
  122. package/dist/smaatoBidAdapter.js +1 -1
  123. package/dist/smartadserverBidAdapter.js +1 -1
  124. package/dist/smarthubBidAdapter.js +1 -1
  125. package/dist/smartxBidAdapter.js +1 -1
  126. package/dist/smilewantedBidAdapter.js +1 -1
  127. package/dist/sonobiBidAdapter.js +1 -1
  128. package/dist/sovrnAnalyticsAdapter.js +1 -1
  129. package/dist/sovrnBidAdapter.js +1 -1
  130. package/dist/sspBCBidAdapter.js +1 -1
  131. package/dist/stvBidAdapter.js +1 -1
  132. package/dist/sublimeBidAdapter.js +1 -1
  133. package/dist/synacormediaBidAdapter.js +1 -1
  134. package/dist/targetVideoBidAdapter.js +1 -1
  135. package/dist/teadsBidAdapter.js +1 -1
  136. package/dist/trionBidAdapter.js +1 -1
  137. package/dist/tripleliftBidAdapter.js +1 -1
  138. package/dist/truereachBidAdapter.js +1 -1
  139. package/dist/ttdBidAdapter.js +1 -1
  140. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  141. package/dist/uid2IdSystem.js +1 -1
  142. package/dist/underdogmediaBidAdapter.js +1 -1
  143. package/dist/undertoneBidAdapter.js +1 -1
  144. package/dist/userId.js +1 -1
  145. package/dist/vidazooBidAdapter.js +1 -1
  146. package/dist/videobyteBidAdapter.js +1 -1
  147. package/dist/videoheroesBidAdapter.js +1 -1
  148. package/dist/vidoomyBidAdapter.js +1 -1
  149. package/dist/visiblemeasuresBidAdapter.js +1 -1
  150. package/dist/visxBidAdapter.js +1 -1
  151. package/dist/vrtcalBidAdapter.js +1 -1
  152. package/dist/vuukleBidAdapter.js +1 -1
  153. package/dist/widespaceBidAdapter.js +1 -1
  154. package/dist/winrBidAdapter.js +1 -1
  155. package/dist/yahoosspBidAdapter.js +1 -1
  156. package/dist/yieldmoBidAdapter.js +1 -1
  157. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  158. package/dist/yieldoneBidAdapter.js +1 -1
  159. package/libraries/domainOverrideToRootDomain/index.js +39 -0
  160. package/modules/acuityAdsBidAdapter.js +1 -1
  161. package/modules/amxBidAdapter.js +1 -1
  162. package/modules/amxIdSystem.js +23 -20
  163. package/modules/amxIdSystem.md +7 -7
  164. package/modules/appushBidAdapter.js +1 -1
  165. package/modules/beyondmediaBidAdapter.js +1 -1
  166. package/modules/braveBidAdapter.js +1 -1
  167. package/modules/brightcomBidAdapter.js +1 -1
  168. package/modules/brightcomSSPBidAdapter.js +1 -1
  169. package/modules/coinzillaBidAdapter.js +1 -2
  170. package/modules/compassBidAdapter.js +1 -1
  171. package/modules/connectIdSystem.js +96 -21
  172. package/modules/connectIdSystem.md +6 -5
  173. package/modules/contentexchangeBidAdapter.js +1 -1
  174. package/modules/freewheel-sspBidAdapter.js +8 -0
  175. package/modules/glimpseBidAdapter.js +1 -2
  176. package/modules/globalsunBidAdapter.js +1 -1
  177. package/modules/gridBidAdapter.js +1 -1
  178. package/modules/gridNMBidAdapter.js +1 -1
  179. package/modules/growthCodeIdSystem.js +18 -15
  180. package/modules/gumgumBidAdapter.js +1 -1
  181. package/modules/iqzoneBidAdapter.js +1 -1
  182. package/modules/ivsBidAdapter.js +85 -0
  183. package/modules/ivsBidAdapter.md +34 -0
  184. package/modules/ixBidAdapter.js +42 -105
  185. package/modules/jwplayerVideoProvider.js +25 -32
  186. package/modules/koblerBidAdapter.js +1 -2
  187. package/modules/kueezBidAdapter.js +1 -1
  188. package/modules/liveIntentIdSystem.js +8 -0
  189. package/modules/luponmediaBidAdapter.js +1 -1
  190. package/modules/magniteAnalyticsAdapter.js +76 -3
  191. package/modules/mathildeadsBidAdapter.js +1 -1
  192. package/modules/medianetBidAdapter.js +1 -1
  193. package/modules/mgidBidAdapter.js +178 -26
  194. package/modules/minutemediaBidAdapter.js +1 -1
  195. package/modules/oguryBidAdapter.js +3 -2
  196. package/modules/onomagicBidAdapter.js +1 -2
  197. package/modules/openxBidAdapter.js +192 -563
  198. package/modules/openxBidAdapter.md +22 -20
  199. package/modules/openxOrtbBidAdapter.js +13 -11
  200. package/modules/openxOrtbBidAdapter.md +5 -3
  201. package/modules/operaadsBidAdapter.js +1 -1
  202. package/modules/pubmaticBidAdapter.js +1 -1
  203. package/modules/pubxBidAdapter.js +5 -2
  204. package/modules/riseBidAdapter.js +1 -1
  205. package/modules/sharedIdSystem.js +4 -27
  206. package/modules/sharethroughBidAdapter.js +1 -1
  207. package/modules/shinezBidAdapter.js +1 -1
  208. package/modules/smarthubBidAdapter.js +1 -1
  209. package/modules/synacormediaBidAdapter.js +1 -3
  210. package/modules/truereachBidAdapter.js +1 -2
  211. package/modules/userId/eids.js +18 -0
  212. package/modules/userId/eids.md +16 -0
  213. package/modules/videoheroesBidAdapter.js +1 -1
  214. package/modules/vidoomyBidAdapter.js +22 -1
  215. package/modules/visiblemeasuresBidAdapter.js +1 -1
  216. package/modules/vrtcalBidAdapter.js +1 -1
  217. package/modules/yieldoneBidAdapter.js +1 -1
  218. package/package.json +1 -1
  219. package/src/Renderer.js +2 -1
  220. package/src/native.js +5 -1
  221. package/test/spec/auctionmanager_spec.js +2 -2
  222. package/test/spec/libraries/domainOverrideToRootDomain/index_spec.js +77 -0
  223. package/test/spec/modules/acuityAdsBidAdapter_spec.js +2 -1
  224. package/test/spec/modules/amxIdSystem_spec.js +13 -26
  225. package/test/spec/modules/appushBidAdapter_spec.js +2 -1
  226. package/test/spec/modules/beyondmediaBidAdapter_spec.js +2 -1
  227. package/test/spec/modules/compassBidAdapter_spec.js +2 -1
  228. package/test/spec/modules/connectIdSystem_spec.js +420 -242
  229. package/test/spec/modules/contentexchangeBidAdapter_spec.js +2 -1
  230. package/test/spec/modules/eids_spec.js +30 -0
  231. package/test/spec/modules/freewheel-sspBidAdapter_spec.js +37 -0
  232. package/test/spec/modules/globalsunBidAdapter_spec.js +2 -1
  233. package/test/spec/modules/iqzoneBidAdapter_spec.js +2 -1
  234. package/test/spec/modules/ivsBidAdapter_spec.js +197 -0
  235. package/test/spec/modules/ixBidAdapter_spec.js +84 -71
  236. package/test/spec/modules/koblerBidAdapter_spec.js +0 -20
  237. package/test/spec/modules/liveIntentIdSystem_spec.js +10 -0
  238. package/test/spec/modules/luponmediaBidAdapter_spec.js +1 -1
  239. package/test/spec/modules/magniteAnalyticsAdapter_spec.js +129 -1
  240. package/test/spec/modules/mathildeadsBidAdapter_spec.js +2 -1
  241. package/test/spec/modules/mgidBidAdapter_spec.js +184 -36
  242. package/test/spec/modules/oguryBidAdapter_spec.js +19 -4
  243. package/test/spec/modules/openxBidAdapter_spec.js +1157 -1936
  244. package/test/spec/modules/openxOrtbBidAdapter_spec.js +12 -39
  245. package/test/spec/modules/pubxBidAdapter_spec.js +10 -2
  246. package/test/spec/modules/sharedIdSystem_spec.js +0 -46
  247. package/test/spec/modules/sharethroughBidAdapter_spec.js +2 -1
  248. package/test/spec/modules/smarthubBidAdapter_spec.js +2 -1
  249. package/test/spec/modules/synacormediaBidAdapter_spec.js +0 -26
  250. package/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +17 -4
  251. package/test/spec/modules/vidoomyBidAdapter_spec.js +35 -0
  252. package/test/spec/modules/visiblemeasuresBidAdapter_spec.js +2 -1
  253. package/test/spec/modules/vrtcalBidAdapter_spec.js +3 -2
  254. package/test/spec/renderer_spec.js +1 -2
@@ -300,6 +300,18 @@ describe('OpenxRtbAdapter', function () {
300
300
  });
301
301
 
302
302
  context('common requests checks', function() {
303
+ it('should be able to handle multiformat requests', () => {
304
+ const multiformat = utils.deepClone(bidRequestsWithMediaTypes[0]);
305
+ multiformat.mediaTypes.video = {
306
+ context: 'outstream',
307
+ playerSize: [640, 480]
308
+ }
309
+ const requests = spec.buildRequests([multiformat], mockBidderRequest);
310
+ const outgoingFormats = requests.flatMap(rq => rq.data.imp.flatMap(imp => ['banner', 'video'].filter(k => imp[k] != null)));
311
+ const expected = FEATURES.VIDEO ? ['banner', 'video'] : ['banner']
312
+ expect(outgoingFormats).to.have.members(expected);
313
+ })
314
+
303
315
  it('should send bid request to openx url via POST', function () {
304
316
  const request = spec.buildRequests(bidRequestsWithMediaTypes, mockBidderRequest);
305
317
  expect(request[0].url).to.equal(REQUEST_URL);
@@ -1084,45 +1096,6 @@ describe('OpenxRtbAdapter', function () {
1084
1096
  });
1085
1097
  });
1086
1098
  }
1087
-
1088
- it.skip('should send ad unit ids when any are defined', function () {
1089
- const bidRequestsWithUnitIds = [{
1090
- bidder: 'openx',
1091
- params: {
1092
- delDomain: 'test-del-domain'
1093
- },
1094
- adUnitCode: 'adunit-code',
1095
- mediaTypes: {
1096
- banner: {
1097
- sizes: [[300, 250], [300, 600]]
1098
- }
1099
- },
1100
- bidId: 'test-bid-id-1',
1101
- bidderRequestId: 'test-bid-request-1',
1102
- auctionId: 'test-auction-1',
1103
- transactionId: 'test-transaction-id-1'
1104
- }, {
1105
- bidder: 'openx',
1106
- params: {
1107
- unit: '22',
1108
- delDomain: 'test-del-domain'
1109
- },
1110
- adUnitCode: 'adunit-code',
1111
- mediaTypes: {
1112
- banner: {
1113
- sizes: [[728, 90]]
1114
- }
1115
- },
1116
- bidId: 'test-bid-id-2',
1117
- bidderRequestId: 'test-bid-request-2',
1118
- auctionId: 'test-auction-2',
1119
- transactionId: 'test-transaction-id-2'
1120
- }];
1121
- mockBidderRequest.bids = bidRequestsWithUnitIds;
1122
- const request = spec.buildRequests(bidRequestsWithUnitIds, mockBidderRequest);
1123
- expect(request[0].data.imp[1].tagid).to.equal(bidRequestsWithUnitIds[1].params.unit);
1124
- expect(request[0].data.imp[1].ext.divid).to.equal(bidRequestsWithUnitIds[1].params.adUnitCode);
1125
- });
1126
1099
  });
1127
1100
 
1128
1101
  describe('interpretResponse()', function () {
@@ -39,14 +39,22 @@ describe('pubxAdapter', function () {
39
39
  id: '26c1ee0038ac11',
40
40
  params: {
41
41
  sid: '12345abc'
42
+ },
43
+ ortb2: {
44
+ site: {
45
+ page: `${location.href}?test=1`
46
+ }
42
47
  }
43
48
  }
44
49
  ];
45
50
 
46
51
  const data = {
47
52
  banner: {
48
- sid: '12345abc'
49
- }
53
+ sid: '12345abc',
54
+ pu: encodeURIComponent(
55
+ utils.deepAccess(bidRequests[0], 'ortb2.site.page').replace(/\?.*$/, '')
56
+ ),
57
+ },
50
58
  };
51
59
 
52
60
  it('sends bid request to ENDPOINT via GET', function () {
@@ -91,50 +91,4 @@ describe('SharedId System', function () {
91
91
  expect(result).to.be.undefined;
92
92
  });
93
93
  });
94
-
95
- describe('SharedID System domainOverride', () => {
96
- let sandbox, domain, cookies, rejectCookiesFor;
97
-
98
- beforeEach(() => {
99
- sandbox = sinon.createSandbox();
100
- sandbox.stub(document, 'domain').get(() => domain);
101
- cookies = {};
102
- sandbox.stub(storage, 'getCookie').callsFake((key) => cookies[key]);
103
- rejectCookiesFor = null;
104
- sandbox.stub(storage, 'setCookie').callsFake((key, value, expires, sameSite, domain) => {
105
- if (domain !== rejectCookiesFor) {
106
- if (expires != null) {
107
- expires = new Date(expires);
108
- }
109
- if (expires == null || expires > Date.now()) {
110
- cookies[key] = value;
111
- } else {
112
- delete cookies[key];
113
- }
114
- }
115
- });
116
- });
117
-
118
- afterEach(() => {
119
- sandbox.restore();
120
- });
121
-
122
- it('should return TLD if cookies can be set there', () => {
123
- domain = 'sub.domain.com';
124
- rejectCookiesFor = 'com';
125
- expect(sharedIdSystemSubmodule.domainOverride()).to.equal('domain.com');
126
- });
127
-
128
- it('should return undefined when cookies cannot be set', () => {
129
- domain = 'sub.domain.com';
130
- rejectCookiesFor = 'sub.domain.com';
131
- expect(sharedIdSystemSubmodule.domainOverride()).to.be.undefined;
132
- });
133
-
134
- it('should return half-way domain if parent domain rejects cookies', () => {
135
- domain = 'inner.outer.domain.com';
136
- rejectCookiesFor = 'domain.com';
137
- expect(sharedIdSystemSubmodule.domainOverride()).to.equal('outer.domain.com');
138
- });
139
- });
140
94
  });
@@ -248,7 +248,8 @@ describe('sharethrough adapter spec', function () {
248
248
  refererInfo: {
249
249
  ref: 'https://referer.com',
250
250
  },
251
- auctionId: 'auction-id'
251
+ auctionId: 'auction-id',
252
+ timeout: 242
252
253
  };
253
254
  });
254
255
 
@@ -91,7 +91,8 @@ describe('SmartHubBidAdapter', function () {
91
91
  gdprConsent: 'COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw',
92
92
  refererInfo: {
93
93
  page: 'https://test.com'
94
- }
94
+ },
95
+ timeout: 500
95
96
  };
96
97
 
97
98
  describe('isBidRequestValid', function () {
@@ -313,32 +313,6 @@ describe('synacormediaBidAdapter ', function () {
313
313
  expect(req.data.tmax).to.eql(bidderRequestWithTimeout.timeout);
314
314
  });
315
315
 
316
- it('should return tmax equal to smaller global timeout', function () {
317
- let sandbox = sinon.sandbox.create();
318
- sandbox.stub(config, 'getConfig').callsFake(key => {
319
- const config = {
320
- 'bidderTimeout': bidderRequestWithTimeout.timeout - 100
321
- };
322
- return config[key];
323
- });
324
- let req = spec.buildRequests([validBidRequest], bidderRequestWithTimeout);
325
- sandbox.restore();
326
- expect(req.data.tmax).to.eql(bidderRequestWithTimeout.timeout - 100);
327
- });
328
-
329
- it('should return tmax equal to smaller callback timeout', function () {
330
- let sandbox = sinon.sandbox.create();
331
- sandbox.stub(config, 'getConfig').callsFake(key => {
332
- const config = {
333
- 'bidderTimeout': bidderRequestWithTimeout.timeout + 100
334
- };
335
- return config[key];
336
- });
337
- let req = spec.buildRequests([validBidRequest], bidderRequestWithTimeout);
338
- sandbox.restore();
339
- expect(req.data.tmax).to.eql(bidderRequestWithTimeout.timeout);
340
- });
341
-
342
316
  it('should return multiple bids when multiple valid requests with the same seatId are used', function () {
343
317
  let secondBidRequest = {
344
318
  bidId: 'foobar',
@@ -19,7 +19,7 @@ import { PLAYBACK_MODE } from 'libraries/video/constants/constants.js';
19
19
  function getPlayerMock() {
20
20
  return makePlayerFactoryMock({
21
21
  getState: function () {},
22
- setup: function () {},
22
+ setup: function () { return this; },
23
23
  getViewable: function () {},
24
24
  getPercentViewable: function () {},
25
25
  getMute: function () {},
@@ -30,8 +30,8 @@ function getPlayerMock() {
30
30
  getFullscreen: function () {},
31
31
  getPlaylistItem: function () {},
32
32
  playAd: function () {},
33
- on: function () {},
34
- off: function () {},
33
+ on: function () { return this; },
34
+ off: function () { return this; },
35
35
  remove: function () {},
36
36
  getAudioTracks: function () {},
37
37
  getCurrentAudioTrack: function () {},
@@ -142,7 +142,7 @@ describe('JWPlayerProvider', function () {
142
142
  it('should instantiate the player when uninstantiated', function () {
143
143
  const player = getPlayerMock();
144
144
  config.playerConfig = {};
145
- const setupSpy = player.setup = sinon.spy();
145
+ const setupSpy = player.setup = sinon.spy(player.setup);
146
146
  const provider = JWPlayerProvider(config, makePlayerFactoryMock(player), adState, timeState, callbackStorage, utilsMock, sharedUtils);
147
147
  provider.init();
148
148
  expect(setupSpy.calledOnce).to.be.true;
@@ -158,6 +158,19 @@ describe('JWPlayerProvider', function () {
158
158
  expect(setupComplete.calledOnce).to.be.true;
159
159
  });
160
160
 
161
+ it('should support multiple setup complete event handlers', function () {
162
+ const player = getPlayerMock();
163
+ player.getState = () => 'idle';
164
+ const provider = JWPlayerProvider(config, makePlayerFactoryMock(player), adState, timeState, callbackStorage, utilsMock, sharedUtils);
165
+ const setupComplete = sinon.spy();
166
+ const setupComplete2 = sinon.spy();
167
+ provider.onEvent(SETUP_COMPLETE, setupComplete, {});
168
+ provider.onEvent(SETUP_COMPLETE, setupComplete2, {});
169
+ provider.init();
170
+ expect(setupComplete.calledOnce).to.be.true;
171
+ expect(setupComplete2.calledOnce).to.be.true;
172
+ });
173
+
161
174
  it('should not reinstantiate player', function () {
162
175
  const player = getPlayerMock();
163
176
  player.getState = () => 'idle';
@@ -161,6 +161,41 @@ describe('vidoomyBidAdapter', function() {
161
161
  expect(request[0].data).to.include.any.keys('schain');
162
162
  expect(request[0].data.schain).to.eq(serializedForm);
163
163
  });
164
+
165
+ it('should set the bidfloor if getFloor module is undefined but static bidfloor is present', function () {
166
+ const request = { ...bidRequests[0], params: { bidfloor: 2.5 } }
167
+ const req = spec.buildRequests([request], bidderRequest)[0];
168
+ expect(req.data).to.include.any.keys('bidfloor');
169
+ expect(req.data.bidfloor).to.equal(2.5);
170
+ });
171
+
172
+ describe('floorModule', function () {
173
+ const getFloordata = {
174
+ 'currency': 'USD',
175
+ 'floor': 1.60
176
+ };
177
+ bidRequests[0].getFloor = _ => {
178
+ return getFloordata;
179
+ };
180
+ it('should return getFloor.floor if present', function () {
181
+ const request = spec.buildRequests(bidRequests, bidderRequest)[0];
182
+ expect(request.data.bidfloor).to.equal(getFloordata.floor);
183
+ });
184
+ it('should return the getFloor.floor if it is greater than static bidfloor', function () {
185
+ const bidfloor = 1.40;
186
+ const request = { ...bidRequests[0] };
187
+ request.params.bidfloor = bidfloor;
188
+ const bidRequest = spec.buildRequests([request], bidderRequest)[0];
189
+ expect(bidRequest.data.bidfloor).to.equal(getFloordata.floor);
190
+ });
191
+ it('should return the static bidfloor if it is greater than getFloor.floor', function () {
192
+ const bidfloor = 1.90;
193
+ const request = { ...bidRequests[0] };
194
+ request.params.bidfloor = bidfloor;
195
+ const bidRequest = spec.buildRequests([request], bidderRequest)[0];
196
+ expect(bidRequest.data.bidfloor).to.equal(bidfloor);
197
+ });
198
+ });
164
199
  });
165
200
 
166
201
  describe('interpretResponse', function () {
@@ -78,7 +78,8 @@ describe('VisibleMeasuresBidAdapter', function () {
78
78
  gdprConsent: 'COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw',
79
79
  refererInfo: {
80
80
  referer: 'https://test.com'
81
- }
81
+ },
82
+ timeout: 500
82
83
  };
83
84
 
84
85
  describe('isBidRequestValid', function () {
@@ -28,7 +28,8 @@ describe('vrtcalBidAdapter', function () {
28
28
  'bidId': 'bidID0001',
29
29
  'bidderRequestId': 'br0001',
30
30
  'auctionId': 'auction0001',
31
- 'userIdAsEids': {}
31
+ 'userIdAsEids': {},
32
+ timeout: 435
32
33
  }
33
34
  ];
34
35
 
@@ -95,7 +96,7 @@ describe('vrtcalBidAdapter', function () {
95
96
  w: 300,
96
97
  h: 250,
97
98
  crid: 'v2_1064_vrt_vrtcaltestdisplay2_300_250',
98
- adomain: ['vrtcal.com']
99
+ adomain: ['vrtcal.com'],
99
100
  }],
100
101
  seat: '16'
101
102
  }],
@@ -52,7 +52,7 @@ describe('Renderer', function () {
52
52
  expect(testRenderer2.getConfig()).to.deep.equal({ test: 'config2' });
53
53
  });
54
54
 
55
- it('sets a render function with setRender method', function () {
55
+ it('sets a render function with the setRender method', function () {
56
56
  testRenderer1.setRender(spyRenderFn);
57
57
  expect(typeof testRenderer1.render).to.equal('function');
58
58
  testRenderer1.render();
@@ -110,7 +110,6 @@ describe('Renderer', function () {
110
110
 
111
111
  it('renders immediately when requested', function () {
112
112
  const testRenderer3 = Renderer.install({
113
- url: 'https://httpbin.org/post',
114
113
  config: { test: 'config2' },
115
114
  id: 2,
116
115
  renderNow: true