prebid.js 6.22.0 → 6.23.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 (164) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -0
  3. package/dist/adagioBidAdapter.js +1 -1
  4. package/dist/adbookpspBidAdapter.js +1 -1
  5. package/dist/adfBidAdapter.js +1 -1
  6. package/dist/adgenerationBidAdapter.js +1 -1
  7. package/dist/adrelevantisBidAdapter.js +1 -1
  8. package/dist/adxcgBidAdapter.js +1 -1
  9. package/dist/adyoulikeBidAdapter.js +1 -1
  10. package/dist/ajaBidAdapter.js +1 -1
  11. package/dist/amxBidAdapter.js +1 -1
  12. package/dist/amxIdSystem.js +1 -1
  13. package/dist/appierAnalyticsAdapter.js +1 -1
  14. package/dist/appnexusBidAdapter.js +1 -1
  15. package/dist/asealBidAdapter.js +1 -1
  16. package/dist/asoBidAdapter.js +1 -1
  17. package/dist/audiencerunBidAdapter.js +1 -1
  18. package/dist/automatadBidAdapter.js +1 -1
  19. package/dist/axonixBidAdapter.js +1 -1
  20. package/dist/bidglassBidAdapter.js +1 -1
  21. package/dist/big-richmediaBidAdapter.js +1 -1
  22. package/dist/bizzclickBidAdapter.js +1 -1
  23. package/dist/bluebillywigBidAdapter.js +1 -1
  24. package/dist/bridgewellBidAdapter.js +1 -1
  25. package/dist/brightMountainMediaBidAdapter.js +1 -1
  26. package/dist/concertBidAdapter.js +1 -1
  27. package/dist/connectadBidAdapter.js +1 -1
  28. package/dist/consumableBidAdapter.js +1 -1
  29. package/dist/conversantBidAdapter.js +1 -1
  30. package/dist/craftBidAdapter.js +1 -1
  31. package/dist/criteoBidAdapter.js +1 -1
  32. package/dist/dspxBidAdapter.js +1 -1
  33. package/dist/eplanningBidAdapter.js +1 -1
  34. package/dist/glimpseBidAdapter.js +1 -1
  35. package/dist/gmosspBidAdapter.js +1 -1
  36. package/dist/goldbachBidAdapter.js +1 -1
  37. package/dist/gridBidAdapter.js +1 -1
  38. package/dist/gridNMBidAdapter.js +1 -1
  39. package/dist/gumgumBidAdapter.js +1 -1
  40. package/dist/h12mediaBidAdapter.js +1 -1
  41. package/dist/id5IdSystem.js +1 -1
  42. package/dist/impactifyBidAdapter.js +1 -1
  43. package/dist/improvedigitalBidAdapter.js +1 -1
  44. package/dist/inmarBidAdapter.js +1 -1
  45. package/dist/insticatorBidAdapter.js +1 -1
  46. package/dist/ixBidAdapter.js +1 -1
  47. package/dist/jixieBidAdapter.js +1 -1
  48. package/dist/justpremiumBidAdapter.js +1 -1
  49. package/dist/jwplayerRtdProvider.js +1 -1
  50. package/dist/konduitAnalyticsAdapter.js +1 -1
  51. package/dist/livewrappedBidAdapter.js +1 -1
  52. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  53. package/dist/logicadBidAdapter.js +1 -1
  54. package/dist/loglyliftBidAdapter.js +1 -1
  55. package/dist/malltvAnalyticsAdapter.js +1 -1
  56. package/dist/marsmediaBidAdapter.js +1 -1
  57. package/dist/mediafuseBidAdapter.js +1 -1
  58. package/dist/mediakeysBidAdapter.js +1 -1
  59. package/dist/mediasquareBidAdapter.js +1 -1
  60. package/dist/mgidBidAdapter.js +1 -1
  61. package/dist/minutemediaBidAdapter.js +1 -1
  62. package/dist/not-for-prod/prebid.js +117 -116
  63. package/dist/oguryBidAdapter.js +1 -1
  64. package/dist/oneVideoBidAdapter.js +1 -1
  65. package/dist/onetagBidAdapter.js +1 -1
  66. package/dist/ooloAnalyticsAdapter.js +1 -1
  67. package/dist/outbrainBidAdapter.js +1 -1
  68. package/dist/parrableIdSystem.js +1 -1
  69. package/dist/pixfutureBidAdapter.js +1 -1
  70. package/dist/prebid-core.js +3 -3
  71. package/dist/prebidServerBidAdapter.js +1 -1
  72. package/dist/publinkIdSystem.js +1 -1
  73. package/dist/pubmaticBidAdapter.js +1 -1
  74. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  75. package/dist/pxyzBidAdapter.js +1 -1
  76. package/dist/quantcastBidAdapter.js +1 -1
  77. package/dist/readpeakBidAdapter.js +1 -1
  78. package/dist/relaidoBidAdapter.js +1 -1
  79. package/dist/rhythmoneBidAdapter.js +1 -1
  80. package/dist/riseBidAdapter.js +1 -1
  81. package/dist/rubiconAnalyticsAdapter.js +1 -1
  82. package/dist/rubiconBidAdapter.js +1 -1
  83. package/dist/seedingAllianceBidAdapter.js +1 -1
  84. package/dist/seedtagBidAdapter.js +1 -1
  85. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  86. package/dist/sharethroughBidAdapter.js +1 -1
  87. package/dist/smaatoBidAdapter.js +1 -1
  88. package/dist/smartadserverBidAdapter.js +1 -1
  89. package/dist/smartxBidAdapter.js +1 -1
  90. package/dist/smilewantedBidAdapter.js +1 -1
  91. package/dist/sonobiBidAdapter.js +1 -1
  92. package/dist/sortableBidAdapter.js +1 -1
  93. package/dist/sovrnAnalyticsAdapter.js +1 -1
  94. package/dist/sovrnBidAdapter.js +1 -1
  95. package/dist/sspBCBidAdapter.js +1 -1
  96. package/dist/sublimeBidAdapter.js +1 -1
  97. package/dist/synacormediaBidAdapter.js +1 -1
  98. package/dist/targetVideoBidAdapter.js +1 -1
  99. package/dist/teadsBidAdapter.js +1 -1
  100. package/dist/trionBidAdapter.js +1 -1
  101. package/dist/tripleliftBidAdapter.js +1 -1
  102. package/dist/trustxBidAdapter.js +1 -1
  103. package/dist/ttdBidAdapter.js +1 -1
  104. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  105. package/dist/underdogmediaBidAdapter.js +1 -1
  106. package/dist/undertoneBidAdapter.js +1 -1
  107. package/dist/userId.js +1 -1
  108. package/dist/vidazooBidAdapter.js +1 -1
  109. package/dist/videobyteBidAdapter.js +1 -1
  110. package/dist/visxBidAdapter.js +1 -1
  111. package/dist/vuukleBidAdapter.js +1 -1
  112. package/dist/widespaceBidAdapter.js +1 -1
  113. package/dist/winrBidAdapter.js +1 -1
  114. package/dist/yahoosspBidAdapter.js +1 -1
  115. package/dist/yieldmoBidAdapter.js +1 -1
  116. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  117. package/integrationExamples/gpt/userId_example.html +12 -0
  118. package/modules/.submodules.json +1 -0
  119. package/modules/33acrossIdSystem.js +115 -0
  120. package/modules/33acrossIdSystem.md +53 -0
  121. package/modules/adagioBidAdapter.js +45 -5
  122. package/modules/adfBidAdapter.js +5 -0
  123. package/modules/adyoulikeBidAdapter.js +1 -9
  124. package/modules/asealBidAdapter.js +62 -14
  125. package/modules/automatadBidAdapter.js +24 -11
  126. package/modules/automatadBidAdapter.md +2 -2
  127. package/modules/big-richmediaBidAdapter.js +9 -1
  128. package/modules/bizzclickBidAdapter.js +5 -14
  129. package/modules/criteoBidAdapter.js +20 -20
  130. package/modules/improvedigitalBidAdapter.js +10 -6
  131. package/modules/insticatorBidAdapter.js +14 -4
  132. package/modules/jixieBidAdapter.js +29 -0
  133. package/modules/jixieBidAdapter.md +1 -0
  134. package/modules/jwplayerRtdProvider.js +27 -9
  135. package/modules/jwplayerRtdProvider.md +5 -3
  136. package/modules/livewrappedBidAdapter.js +1 -1
  137. package/modules/minutemediaBidAdapter.js +206 -135
  138. package/modules/minutemediaBidAdapter.md +42 -17
  139. package/modules/prebidServerBidAdapter/index.js +4 -1
  140. package/modules/sovrnBidAdapter.js +16 -3
  141. package/modules/tripleliftBidAdapter.js +13 -9
  142. package/modules/userId/eids.js +9 -0
  143. package/modules/userId/eids.md +7 -0
  144. package/modules/userId/index.js +5 -2
  145. package/modules/userId/userId.md +23 -2
  146. package/package.json +1 -1
  147. package/test/spec/modules/33acrossIdSystem_spec.js +413 -0
  148. package/test/spec/modules/adagioBidAdapter_spec.js +11 -2
  149. package/test/spec/modules/adfBidAdapter_spec.js +27 -0
  150. package/test/spec/modules/asealBidAdapter_spec.js +134 -65
  151. package/test/spec/modules/automatadBidAdapter_spec.js +28 -11
  152. package/test/spec/modules/criteoBidAdapter_spec.js +33 -33
  153. package/test/spec/modules/eids_spec.js +17 -0
  154. package/test/spec/modules/improvedigitalBidAdapter_spec.js +27 -5
  155. package/test/spec/modules/insticatorBidAdapter_spec.js +24 -15
  156. package/test/spec/modules/jixieBidAdapter_spec.js +96 -0
  157. package/test/spec/modules/jwplayerRtdProvider_spec.js +50 -14
  158. package/test/spec/modules/livewrappedBidAdapter_spec.js +3 -1
  159. package/test/spec/modules/minutemediaBidAdapter_spec.js +196 -122
  160. package/test/spec/modules/prebidServerBidAdapter_spec.js +4 -0
  161. package/test/spec/modules/sovrnBidAdapter_spec.js +12 -0
  162. package/test/spec/modules/tripleliftBidAdapter_spec.js +12 -2
  163. package/test/spec/modules/userId_spec.js +8 -0
  164. package/modules/pubnxBidAdapter.md +0 -31
@@ -2,12 +2,13 @@ import { expect } from 'chai';
2
2
  import { spec } from 'modules/minutemediaBidAdapter.js';
3
3
  import { newBidder } from 'src/adapters/bidderFactory.js';
4
4
  import { config } from 'src/config.js';
5
- import { VIDEO } from '../../../src/mediaTypes.js';
6
- import { deepClone } from 'src/utils.js';
5
+ import { BANNER, VIDEO } from '../../../src/mediaTypes.js';
6
+ import * as utils from 'src/utils.js';
7
7
 
8
- const ENDPOINT = 'https://hb.minutemedia-prebid.com/hb-mm';
9
- const TEST_ENDPOINT = 'https://hb.minutemedia-prebid.com/hb-mm-test';
8
+ const ENDPOINT = 'https://hb.minutemedia-prebid.com/hb-mm-multi';
9
+ const TEST_ENDPOINT = 'https://hb.minutemedia-prebid.com/hb-multi-mm-test';
10
10
  const TTL = 360;
11
+ /* eslint no-console: ["error", { allow: ["log", "warn", "error"] }] */
11
12
 
12
13
  describe('minutemediaAdapter', function () {
13
14
  const adapter = newBidder(spec);
@@ -54,6 +55,29 @@ describe('minutemediaAdapter', function () {
54
55
  'bidId': '299ffc8cca0b87',
55
56
  'bidderRequestId': '1144f487e563f9',
56
57
  'auctionId': 'bfc420c3-8577-4568-9766-a8a935fb620d',
58
+ 'mediaTypes': {
59
+ 'video': {
60
+ 'playerSize': [[640, 480]],
61
+ 'context': 'instream'
62
+ }
63
+ },
64
+ 'vastXml': '"<VAST version=\\\"2.0\\\">...</VAST>"'
65
+ },
66
+ {
67
+ 'bidder': spec.code,
68
+ 'adUnitCode': 'adunit-code',
69
+ 'sizes': [[300, 250]],
70
+ 'params': {
71
+ 'org': 'jdye8weeyirk00000001'
72
+ },
73
+ 'bidId': '299ffc8cca0b87',
74
+ 'bidderRequestId': '1144f487e563f9',
75
+ 'auctionId': 'bfc420c3-8577-4568-9766-a8a935fb620d',
76
+ 'mediaTypes': {
77
+ 'banner': {
78
+ }
79
+ },
80
+ 'ad': '"<img src=\"https://...\"/>"'
57
81
  }
58
82
  ];
59
83
 
@@ -77,44 +101,41 @@ describe('minutemediaAdapter', function () {
77
101
  }
78
102
  const placementId = '12345678';
79
103
 
80
- it('sends the placementId as a query param', function () {
104
+ it('sends the placementId to ENDPOINT via POST', function () {
81
105
  bidRequests[0].params.placementId = placementId;
82
- const requests = spec.buildRequests(bidRequests, bidderRequest);
83
- for (const request of requests) {
84
- expect(request.data.placement_id).to.equal(placementId);
85
- }
106
+ const request = spec.buildRequests(bidRequests, bidderRequest);
107
+ expect(request.data.bids[0].placementId).to.equal(placementId);
86
108
  });
87
109
 
88
- it('sends bid request to ENDPOINT via GET', function () {
89
- const requests = spec.buildRequests(bidRequests, bidderRequest);
90
- for (const request of requests) {
91
- expect(request.url).to.equal(ENDPOINT);
92
- expect(request.method).to.equal('GET');
93
- }
110
+ it('sends bid request to ENDPOINT via POST', function () {
111
+ const request = spec.buildRequests(bidRequests, bidderRequest);
112
+ expect(request.url).to.equal(ENDPOINT);
113
+ expect(request.method).to.equal('POST');
94
114
  });
95
115
 
96
- it('sends bid request to test ENDPOINT via GET', function () {
97
- const requests = spec.buildRequests(testModeBidRequests, bidderRequest);
98
- for (const request of requests) {
99
- expect(request.url).to.equal(TEST_ENDPOINT);
100
- expect(request.method).to.equal('GET');
101
- }
116
+ it('sends bid request to TEST ENDPOINT via POST', function () {
117
+ const request = spec.buildRequests(testModeBidRequests, bidderRequest);
118
+ expect(request.url).to.equal(TEST_ENDPOINT);
119
+ expect(request.method).to.equal('POST');
102
120
  });
103
121
 
104
122
  it('should send the correct bid Id', function () {
105
- const requests = spec.buildRequests(bidRequests, bidderRequest);
106
- for (const request of requests) {
107
- expect(request.data.bid_id).to.equal('299ffc8cca0b87');
108
- }
123
+ const request = spec.buildRequests(bidRequests, bidderRequest);
124
+ expect(request.data.bids[0].bidId).to.equal('299ffc8cca0b87');
109
125
  });
110
126
 
111
- it('should send the correct width and height', function () {
112
- const requests = spec.buildRequests(bidRequests, bidderRequest);
113
- for (const request of requests) {
114
- expect(request.data).to.be.an('object');
115
- expect(request.data).to.have.property('width', 640);
116
- expect(request.data).to.have.property('height', 480);
117
- }
127
+ it('should send the correct sizes array', function () {
128
+ const request = spec.buildRequests(bidRequests, bidderRequest);
129
+ expect(request.data.bids[0].sizes).to.be.an('array');
130
+ expect(request.data.bids[0].sizes).to.equal(bidRequests[0].sizes)
131
+ expect(request.data.bids[1].sizes).to.be.an('array');
132
+ expect(request.data.bids[1].sizes).to.equal(bidRequests[1].sizes)
133
+ });
134
+
135
+ it('should send the correct media type', function () {
136
+ const request = spec.buildRequests(bidRequests, bidderRequest);
137
+ expect(request.data.bids[0].mediaType).to.equal(VIDEO)
138
+ expect(request.data.bids[1].mediaType).to.equal(BANNER)
118
139
  });
119
140
 
120
141
  it('should respect syncEnabled option', function() {
@@ -129,11 +150,9 @@ describe('minutemediaAdapter', function () {
129
150
  }
130
151
  }
131
152
  });
132
- const requests = spec.buildRequests(bidRequests, bidderRequest);
133
- for (const request of requests) {
134
- expect(request.data).to.be.an('object');
135
- expect(request.data).to.not.have.property('cs_method');
136
- }
153
+ const request = spec.buildRequests(bidRequests, bidderRequest);
154
+ expect(request.data.params).to.be.an('object');
155
+ expect(request.data.params).to.not.have.property('cs_method');
137
156
  });
138
157
 
139
158
  it('should respect "iframe" filter settings', function () {
@@ -148,11 +167,9 @@ describe('minutemediaAdapter', function () {
148
167
  }
149
168
  }
150
169
  });
151
- const requests = spec.buildRequests(bidRequests, bidderRequest);
152
- for (const request of requests) {
153
- expect(request.data).to.be.an('object');
154
- expect(request.data).to.have.property('cs_method', 'iframe');
155
- }
170
+ const request = spec.buildRequests(bidRequests, bidderRequest);
171
+ expect(request.data.params).to.be.an('object');
172
+ expect(request.data.params).to.have.property('cs_method', 'iframe');
156
173
  });
157
174
 
158
175
  it('should respect "all" filter settings', function () {
@@ -167,24 +184,21 @@ describe('minutemediaAdapter', function () {
167
184
  }
168
185
  }
169
186
  });
170
- const requests = spec.buildRequests(bidRequests, bidderRequest);
171
- for (const request of requests) {
172
- expect(request.data).to.be.an('object');
173
- expect(request.data).to.have.property('cs_method', 'iframe');
174
- }
187
+ const request = spec.buildRequests(bidRequests, bidderRequest);
188
+ expect(request.data.params).to.be.an('object');
189
+ expect(request.data.params).to.have.property('cs_method', 'iframe');
175
190
  });
176
191
 
177
192
  it('should send the pixel user sync param if userSync is enabled and no "iframe" or "all" configs are present', function () {
193
+ config.resetConfig();
178
194
  config.setConfig({
179
195
  userSync: {
180
- syncEnabled: true
196
+ syncEnabled: true,
181
197
  }
182
198
  });
183
- const requests = spec.buildRequests(bidRequests, bidderRequest);
184
- for (const request of requests) {
185
- expect(request.data).to.be.an('object');
186
- expect(request.data).to.have.property('cs_method', 'pixel');
187
- }
199
+ const request = spec.buildRequests(bidRequests, bidderRequest);
200
+ expect(request.data.params).to.be.an('object');
201
+ expect(request.data.params).to.have.property('cs_method', 'pixel');
188
202
  });
189
203
 
190
204
  it('should respect total exclusion', function() {
@@ -203,48 +217,38 @@ describe('minutemediaAdapter', function () {
203
217
  }
204
218
  }
205
219
  });
206
- const requests = spec.buildRequests(bidRequests, bidderRequest);
207
- for (const request of requests) {
208
- expect(request.data).to.be.an('object');
209
- expect(request.data).to.not.have.property('cs_method');
210
- }
220
+ const request = spec.buildRequests(bidRequests, bidderRequest);
221
+ expect(request.data.params).to.be.an('object');
222
+ expect(request.data.params).to.not.have.property('cs_method');
211
223
  });
212
224
 
213
225
  it('should have us_privacy param if usPrivacy is available in the bidRequest', function () {
214
226
  const bidderRequestWithUSP = Object.assign({uspConsent: '1YNN'}, bidderRequest);
215
- const requests = spec.buildRequests(bidRequests, bidderRequestWithUSP);
216
- for (const request of requests) {
217
- expect(request.data).to.be.an('object');
218
- expect(request.data).to.have.property('us_privacy', '1YNN');
219
- }
227
+ const request = spec.buildRequests(bidRequests, bidderRequestWithUSP);
228
+ expect(request.data.params).to.be.an('object');
229
+ expect(request.data.params).to.have.property('us_privacy', '1YNN');
220
230
  });
221
231
 
222
232
  it('should have an empty us_privacy param if usPrivacy is missing in the bidRequest', function () {
223
- const requests = spec.buildRequests(bidRequests, bidderRequest);
224
- for (const request of requests) {
225
- expect(request.data).to.be.an('object');
226
- expect(request.data).to.not.have.property('us_privacy');
227
- }
233
+ const request = spec.buildRequests(bidRequests, bidderRequest);
234
+ expect(request.data.params).to.be.an('object');
235
+ expect(request.data.params).to.not.have.property('us_privacy');
228
236
  });
229
237
 
230
238
  it('should not send the gdpr param if gdprApplies is false in the bidRequest', function () {
231
239
  const bidderRequestWithGDPR = Object.assign({gdprConsent: {gdprApplies: false}}, bidderRequest);
232
- const requests = spec.buildRequests(bidRequests, bidderRequestWithGDPR);
233
- for (const request of requests) {
234
- expect(request.data).to.be.an('object');
235
- expect(request.data).to.not.have.property('gdpr');
236
- expect(request.data).to.not.have.property('gdpr_consent');
237
- }
240
+ const request = spec.buildRequests(bidRequests, bidderRequestWithGDPR);
241
+ expect(request.data.params).to.be.an('object');
242
+ expect(request.data.params).to.not.have.property('gdpr');
243
+ expect(request.data.params).to.not.have.property('gdpr_consent');
238
244
  });
239
245
 
240
246
  it('should send the gdpr param if gdprApplies is true in the bidRequest', function () {
241
247
  const bidderRequestWithGDPR = Object.assign({gdprConsent: {gdprApplies: true, consentString: 'test-consent-string'}}, bidderRequest);
242
- const requests = spec.buildRequests(bidRequests, bidderRequestWithGDPR);
243
- for (const request of requests) {
244
- expect(request.data).to.be.an('object');
245
- expect(request.data).to.have.property('gdpr', true);
246
- expect(request.data).to.have.property('gdpr_consent', 'test-consent-string');
247
- }
248
+ const request = spec.buildRequests(bidRequests, bidderRequestWithGDPR);
249
+ expect(request.data.params).to.be.an('object');
250
+ expect(request.data.params).to.have.property('gdpr', true);
251
+ expect(request.data.params).to.have.property('gdpr_consent', 'test-consent-string');
248
252
  });
249
253
 
250
254
  it('should have schain param if it is available in the bidRequest', () => {
@@ -254,15 +258,13 @@ describe('minutemediaAdapter', function () {
254
258
  nodes: [{ asi: 'indirectseller.com', sid: '00001', hp: 1 }],
255
259
  };
256
260
  bidRequests[0].schain = schain;
257
- const requests = spec.buildRequests(bidRequests, bidderRequest);
258
- for (const request of requests) {
259
- expect(request.data).to.be.an('object');
260
- expect(request.data).to.have.property('schain', '1.0,1!indirectseller.com,00001,1,,,');
261
- }
261
+ const request = spec.buildRequests(bidRequests, bidderRequest);
262
+ expect(request.data.params).to.be.an('object');
263
+ expect(request.data.params).to.have.property('schain', '1.0,1!indirectseller.com,00001,1,,,');
262
264
  });
263
265
 
264
- it('should set floor_price to getFloor.floor value if it is greater than params.floorPrice', function() {
265
- const bid = deepClone(bidRequests[0]);
266
+ it('should set flooPrice to getFloor.floor value if it is greater than params.floorPrice', function() {
267
+ const bid = utils.deepClone(bidRequests[0]);
266
268
  bid.getFloor = () => {
267
269
  return {
268
270
  currency: 'USD',
@@ -270,13 +272,13 @@ describe('minutemediaAdapter', function () {
270
272
  }
271
273
  }
272
274
  bid.params.floorPrice = 0.64;
273
- const request = spec.buildRequests([bid], bidderRequest)[0];
274
- expect(request.data).to.be.an('object');
275
- expect(request.data).to.have.property('floor_price', 3.32);
275
+ const request = spec.buildRequests([bid], bidderRequest);
276
+ expect(request.data.bids[0]).to.be.an('object');
277
+ expect(request.data.bids[0]).to.have.property('floorPrice', 3.32);
276
278
  });
277
279
 
278
- it('should set floor_price to params.floorPrice value if it is greater than getFloor.floor', function() {
279
- const bid = deepClone(bidRequests[0]);
280
+ it('should set floorPrice to params.floorPrice value if it is greater than getFloor.floor', function() {
281
+ const bid = utils.deepClone(bidRequests[0]);
280
282
  bid.getFloor = () => {
281
283
  return {
282
284
  currency: 'USD',
@@ -284,61 +286,109 @@ describe('minutemediaAdapter', function () {
284
286
  }
285
287
  }
286
288
  bid.params.floorPrice = 1.5;
287
- const request = spec.buildRequests([bid], bidderRequest)[0];
288
- expect(request.data).to.be.an('object');
289
- expect(request.data).to.have.property('floor_price', 1.5);
289
+ const request = spec.buildRequests([bid], bidderRequest);
290
+ expect(request.data.bids[0]).to.be.an('object');
291
+ expect(request.data.bids[0]).to.have.property('floorPrice', 1.5);
290
292
  });
291
293
  });
292
294
 
293
295
  describe('interpretResponse', function () {
294
296
  const response = {
297
+ params: {
298
+ currency: 'USD',
299
+ netRevenue: true,
300
+ },
301
+ bids: [{
302
+ cpm: 12.5,
303
+ vastXml: '<VAST version="3.0"></VAST>',
304
+ width: 640,
305
+ height: 480,
306
+ requestId: '21e12606d47ba7',
307
+ adomain: ['abc.com'],
308
+ mediaType: VIDEO
309
+ },
310
+ {
311
+ cpm: 12.5,
312
+ ad: '"<img src=\"https://...\"/>"',
313
+ width: 300,
314
+ height: 250,
315
+ requestId: '21e12606d47ba7',
316
+ adomain: ['abc.com'],
317
+ mediaType: BANNER
318
+ }]
319
+ };
320
+
321
+ const expectedVideoResponse = {
322
+ requestId: '21e12606d47ba7',
295
323
  cpm: 12.5,
296
- vastXml: '<VAST version="3.0"></VAST>',
324
+ currency: 'USD',
297
325
  width: 640,
298
326
  height: 480,
299
- requestId: '21e12606d47ba7',
327
+ ttl: TTL,
328
+ creativeId: '21e12606d47ba7',
300
329
  netRevenue: true,
330
+ nurl: 'http://example.com/win/1234',
331
+ mediaType: VIDEO,
332
+ meta: {
333
+ mediaType: VIDEO,
334
+ advertiserDomains: ['abc.com']
335
+ },
336
+ vastXml: '<VAST version="3.0"></VAST>',
337
+ };
338
+
339
+ const expectedBannerResponse = {
340
+ requestId: '21e12606d47ba7',
341
+ cpm: 12.5,
301
342
  currency: 'USD',
302
- adomain: ['abc.com']
343
+ width: 640,
344
+ height: 480,
345
+ ttl: TTL,
346
+ creativeId: '21e12606d47ba7',
347
+ netRevenue: true,
348
+ nurl: 'http://example.com/win/1234',
349
+ mediaType: BANNER,
350
+ meta: {
351
+ mediaType: BANNER,
352
+ advertiserDomains: ['abc.com']
353
+ },
354
+ ad: '"<img src=\"https://...\"/>"'
303
355
  };
304
356
 
305
357
  it('should get correct bid response', function () {
306
- let expectedResponse = [
307
- {
308
- requestId: '21e12606d47ba7',
309
- cpm: 12.5,
310
- width: 640,
311
- height: 480,
312
- creativeId: '21e12606d47ba7',
313
- currency: 'USD',
314
- netRevenue: true,
315
- ttl: TTL,
316
- vastXml: '<VAST version="3.0"></VAST>',
317
- mediaType: VIDEO,
318
- meta: {
319
- advertiserDomains: ['abc.com']
320
- }
321
- }
322
- ];
323
358
  const result = spec.interpretResponse({ body: response });
324
- expect(Object.keys(result[0])).to.have.members(Object.keys(expectedResponse[0]));
359
+ expect(Object.keys(result[0])).to.deep.equal(Object.keys(expectedVideoResponse));
360
+ expect(Object.keys(result[1])).to.deep.equal(Object.keys(expectedBannerResponse));
361
+ });
362
+
363
+ it('video type should have vastXml key', function () {
364
+ const result = spec.interpretResponse({ body: response });
365
+ expect(result[0].vastXml).to.equal(expectedVideoResponse.vastXml)
366
+ });
367
+
368
+ it('banner type should have ad key', function () {
369
+ const result = spec.interpretResponse({ body: response });
370
+ expect(result[1].ad).to.equal(expectedBannerResponse.ad)
325
371
  });
326
372
  })
327
373
 
328
374
  describe('getUserSyncs', function() {
329
375
  const imageSyncResponse = {
330
376
  body: {
331
- userSyncPixels: [
332
- 'https://image-sync-url.test/1',
333
- 'https://image-sync-url.test/2',
334
- 'https://image-sync-url.test/3'
335
- ]
377
+ params: {
378
+ userSyncPixels: [
379
+ 'https://image-sync-url.test/1',
380
+ 'https://image-sync-url.test/2',
381
+ 'https://image-sync-url.test/3'
382
+ ]
383
+ }
336
384
  }
337
385
  };
338
386
 
339
387
  const iframeSyncResponse = {
340
388
  body: {
341
- userSyncURL: 'https://iframe-sync-url.test'
389
+ params: {
390
+ userSyncURL: 'https://iframe-sync-url.test'
391
+ }
342
392
  }
343
393
  };
344
394
 
@@ -402,4 +452,28 @@ describe('minutemediaAdapter', function () {
402
452
  expect(syncs).to.deep.equal([]);
403
453
  });
404
454
  })
455
+
456
+ describe('onBidWon', function() {
457
+ beforeEach(function() {
458
+ sinon.stub(utils, 'triggerPixel');
459
+ });
460
+ afterEach(function() {
461
+ utils.triggerPixel.restore();
462
+ });
463
+
464
+ it('Should trigger pixel if bid nurl', function() {
465
+ const bid = {
466
+ 'bidder': spec.code,
467
+ 'adUnitCode': 'adunit-code',
468
+ 'sizes': [['640', '480']],
469
+ 'nurl': 'http://example.com/win/1234',
470
+ 'params': {
471
+ 'org': 'jdye8weeyirk00000001'
472
+ }
473
+ };
474
+
475
+ spec.onBidWon(bid);
476
+ expect(utils.triggerPixel.callCount).to.equal(1)
477
+ })
478
+ })
405
479
  });
@@ -1279,12 +1279,14 @@ describe('S2S Adapter', function () {
1279
1279
  'assets': [
1280
1280
  {
1281
1281
  'required': 1,
1282
+ 'id': 0,
1282
1283
  'title': {
1283
1284
  'len': 800
1284
1285
  }
1285
1286
  },
1286
1287
  {
1287
1288
  'required': 1,
1289
+ 'id': 1,
1288
1290
  'img': {
1289
1291
  'type': 3,
1290
1292
  'w': 989,
@@ -1293,6 +1295,7 @@ describe('S2S Adapter', function () {
1293
1295
  },
1294
1296
  {
1295
1297
  'required': 1,
1298
+ 'id': 2,
1296
1299
  'img': {
1297
1300
  'type': 1,
1298
1301
  'wmin': 10,
@@ -1304,6 +1307,7 @@ describe('S2S Adapter', function () {
1304
1307
  },
1305
1308
  {
1306
1309
  'required': 1,
1310
+ 'id': 3,
1307
1311
  'data': {
1308
1312
  'type': 1
1309
1313
  }
@@ -51,6 +51,18 @@ describe('sovrnBidAdapter', function() {
51
51
 
52
52
  expect(spec.isBidRequestValid(bidRequest)).to.equal(false);
53
53
  });
54
+
55
+ it('should return false when require video params are not passed', function () {
56
+ const bidRequest = {
57
+ ...baseBidRequest,
58
+ 'mediaTypes': {
59
+ 'video': {
60
+ }
61
+ }
62
+ }
63
+
64
+ expect(spec.isBidRequestValid(bidRequest)).to.equal(false);
65
+ });
54
66
  });
55
67
 
56
68
  describe('buildRequests', function () {
@@ -11,8 +11,7 @@ const GDPR_CONSENT_STR = 'BOONm0NOONm0NABABAENAa-AAAARh7______b9_3__7_9uz_Kv_K7V
11
11
 
12
12
  describe('triplelift adapter', function () {
13
13
  const adapter = newBidder(tripleliftAdapterSpec);
14
- let bid, instreamBid;
15
- let sandbox;
14
+ let bid, instreamBid, sandbox, logErrorSpy;
16
15
 
17
16
  this.beforeEach(() => {
18
17
  bid = {
@@ -379,9 +378,11 @@ describe('triplelift adapter', function () {
379
378
  },
380
379
  };
381
380
  sandbox = sinon.sandbox.create();
381
+ logErrorSpy = sinon.spy(utils, 'logError');
382
382
  });
383
383
  afterEach(() => {
384
384
  sandbox.restore();
385
+ utils.logError.restore();
385
386
  });
386
387
 
387
388
  it('exists and is an object', function () {
@@ -787,6 +788,15 @@ describe('triplelift adapter', function () {
787
788
  size: '*'
788
789
  })).to.be.true;
789
790
  });
791
+ it('should catch error if getFloor throws error', function() {
792
+ bidRequests[0].getFloor = () => {
793
+ throw new Error('An exception!');
794
+ };
795
+
796
+ tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
797
+
798
+ expect(logErrorSpy.calledOnce).to.equal(true);
799
+ });
790
800
  it('should send global config fpd if kvps are available', function() {
791
801
  const sens = null;
792
802
  const category = ['news', 'weather', 'hurricane'];
@@ -497,6 +497,14 @@ describe('User ID', function () {
497
497
  mockIdCallback.callArg(0, {id: {MOCKID: '1111'}});
498
498
  })
499
499
  });
500
+
501
+ it('should not get stuck when init fails', () => {
502
+ const err = new Error();
503
+ mockIdCallback.callsFake(() => { throw err; });
504
+ return getGlobal().getUserIdsAsync().catch((e) =>
505
+ expect(e).to.equal(err)
506
+ );
507
+ });
500
508
  });
501
509
 
502
510
  it('pbjs.refreshUserIds updates submodules', function(done) {
@@ -1,31 +0,0 @@
1
- # Overview
2
-
3
- ```
4
- Module Name: PubNX Bidder Adapter
5
- Module Type: Bidder Adapter
6
- Maintainer: prebid-team@pubnx.com
7
- ```
8
-
9
- # Description
10
-
11
- Connects to PubNX exchange for bids.
12
- PubNX Bidder adapter supports Banner ads.
13
- Use bidder code ```pubnx``` for all PubNX traffic.
14
-
15
- # Test Parameters
16
- ```
17
- var adUnits = [
18
- // Banner adUnit
19
- {
20
- code: 'banner-div',
21
- sizes: [[300, 250], [300,600]], // a display size(s)
22
- bids: [{
23
- bidder: 'pubnx',
24
- params: {
25
- placementId: 'PNX-HB-G396432V4809F3'
26
- }
27
- }]
28
- },
29
- ];
30
- ```
31
-