prebid.js 9.40.0 → 9.41.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 (191) hide show
  1. package/dist/33acrossAnalyticsAdapter.js +1 -1
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.js +1 -1
  4. package/dist/BTBidAdapter.js +1 -1
  5. package/dist/adagioAnalyticsAdapter.js +1 -1
  6. package/dist/adagioBidAdapter.js +1 -1
  7. package/dist/adagioUtils.js +1 -1
  8. package/dist/addefendBidAdapter.js +1 -1
  9. package/dist/adgenerationBidAdapter.js +1 -1
  10. package/dist/adlooxRtdProvider.js +1 -1
  11. package/dist/adqueryBidAdapter.js +1 -1
  12. package/dist/adrelevantisBidAdapter.js +1 -1
  13. package/dist/adstirBidAdapter.js +1 -1
  14. package/dist/adtrgtmeBidAdapter.js +1 -1
  15. package/dist/adxcgAnalyticsAdapter.js +1 -1
  16. package/dist/adxcgBidAdapter.js +1 -1
  17. package/dist/adyoulikeBidAdapter.js +1 -1
  18. package/dist/agmaAnalyticsAdapter.js +1 -1
  19. package/dist/ajaBidAdapter.js +1 -1
  20. package/dist/amxBidAdapter.js +1 -1
  21. package/dist/amxIdSystem.js +1 -1
  22. package/dist/aniviewBidAdapter.js +1 -1
  23. package/dist/appierAnalyticsAdapter.js +1 -1
  24. package/dist/appnexusBidAdapter.js +1 -1
  25. package/dist/asoBidAdapter.js +1 -1
  26. package/dist/axonixBidAdapter.js +1 -1
  27. package/dist/beopBidAdapter.js +1 -1
  28. package/dist/bidglassBidAdapter.js +1 -1
  29. package/dist/big-richmediaBidAdapter.js +1 -1
  30. package/dist/bitmediaBidAdapter.js +1 -1
  31. package/dist/braveUtils.js +1 -1
  32. package/dist/bridBidAdapter.js +1 -1
  33. package/dist/bridgeuppBidAdapter.js +1 -1
  34. package/dist/bridgewellBidAdapter.js +1 -1
  35. package/dist/brightMountainMediaBidAdapter.js +1 -1
  36. package/dist/carodaBidAdapter.js +1 -1
  37. package/dist/chtnwBidAdapter.js +1 -1
  38. package/dist/chunk-core.js +1 -1
  39. package/dist/concertBidAdapter.js +1 -1
  40. package/dist/connectadBidAdapter.js +1 -1
  41. package/dist/consumableBidAdapter.js +1 -1
  42. package/dist/contxtfulBidAdapter.js +1 -1
  43. package/dist/conversantAnalyticsAdapter.js +1 -1
  44. package/dist/conversantBidAdapter.js +1 -1
  45. package/dist/craftBidAdapter.js +1 -1
  46. package/dist/criteoBidAdapter.js +1 -1
  47. package/dist/cwireBidAdapter.js +1 -1
  48. package/dist/dailymotionBidAdapter.js +1 -1
  49. package/dist/dependencies.json +4 -0
  50. package/dist/dspxBidAdapter.js +1 -1
  51. package/dist/dxkultureBidAdapter.js +1 -1
  52. package/dist/eplanningBidAdapter.js +1 -1
  53. package/dist/epomDspBidAdapter.js +1 -0
  54. package/dist/equativBidAdapter.js +1 -1
  55. package/dist/eskimiBidAdapter.js +1 -1
  56. package/dist/euidIdSystem.js +1 -1
  57. package/dist/exadsBidAdapter.js +1 -1
  58. package/dist/excoBidAdapter.js +1 -1
  59. package/dist/feedadBidAdapter.js +1 -1
  60. package/dist/finativeBidAdapter.js +1 -1
  61. package/dist/freewheel-sspBidAdapter.js +1 -1
  62. package/dist/gmosspBidAdapter.js +1 -1
  63. package/dist/goldbachBidAdapter.js +1 -1
  64. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  65. package/dist/greenbidsBidAdapter.js +1 -1
  66. package/dist/greenbidsRtdProvider.js +1 -1
  67. package/dist/gridBidAdapter.js +1 -1
  68. package/dist/gumgumBidAdapter.js +1 -1
  69. package/dist/h12mediaBidAdapter.js +1 -1
  70. package/dist/hypelabBidAdapter.js +1 -1
  71. package/dist/id5AnalyticsAdapter.js +1 -1
  72. package/dist/id5IdSystem.js +1 -1
  73. package/dist/imdsBidAdapter.js +1 -1
  74. package/dist/improvedigitalBidAdapter.js +1 -1
  75. package/dist/inmobiBidAdapter.js +1 -1
  76. package/dist/insticatorBidAdapter.js +1 -1
  77. package/dist/intentIqAnalyticsAdapter.js +1 -1
  78. package/dist/ixBidAdapter.js +1 -1
  79. package/dist/jixieBidAdapter.js +1 -1
  80. package/dist/justpremiumBidAdapter.js +1 -1
  81. package/dist/kargoBidAdapter.js +1 -1
  82. package/dist/kimberliteBidAdapter.js +1 -1
  83. package/dist/konduitAnalyticsAdapter.js +1 -1
  84. package/dist/kueezBidAdapter.js +1 -1
  85. package/dist/lassoBidAdapter.js +1 -1
  86. package/dist/lifestreetBidAdapter.js +1 -1
  87. package/dist/liveIntentId.js +1 -1
  88. package/dist/logicadBidAdapter.js +1 -1
  89. package/dist/loglyliftBidAdapter.js +1 -1
  90. package/dist/luceadBidAdapter.js +1 -1
  91. package/dist/mabidderBidAdapter.js +1 -1
  92. package/dist/madsenseBidAdapter.js +1 -1
  93. package/dist/magniteAnalyticsAdapter.js +1 -1
  94. package/dist/malltvAnalyticsAdapter.js +1 -1
  95. package/dist/marsmediaBidAdapter.js +1 -1
  96. package/dist/mediafuseBidAdapter.js +1 -1
  97. package/dist/medianetBidAdapter.js +1 -1
  98. package/dist/medianetUtils.js +1 -1
  99. package/dist/mediasquareBidAdapter.js +1 -1
  100. package/dist/mgidBidAdapter.js +1 -1
  101. package/dist/missenaBidAdapter.js +1 -1
  102. package/dist/nextMillenniumBidAdapter.js +1 -1
  103. package/dist/nexx360BidAdapter.js +1 -1
  104. package/dist/nobidAnalyticsAdapter.js +1 -1
  105. package/dist/nobidBidAdapter.js +1 -1
  106. package/dist/nodalsAiRtdProvider.js +1 -1
  107. package/dist/not-for-prod/prebid.js +170 -168
  108. package/dist/oguryBidAdapter.js +1 -1
  109. package/dist/onetagBidAdapter.js +1 -1
  110. package/dist/ooloAnalyticsAdapter.js +1 -1
  111. package/dist/openxBidAdapter.js +1 -1
  112. package/dist/optidigitalBidAdapter.js +1 -1
  113. package/dist/orbidderBidAdapter.js +1 -1
  114. package/dist/outbrainBidAdapter.js +1 -1
  115. package/dist/pixfutureBidAdapter.js +1 -1
  116. package/dist/publinkIdSystem.js +1 -1
  117. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  118. package/dist/pubmaticBidAdapter.js +1 -1
  119. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  120. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  121. package/dist/pxyzBidAdapter.js +1 -1
  122. package/dist/quantcastBidAdapter.js +1 -1
  123. package/dist/raveltechRtdProvider.js +1 -0
  124. package/dist/readpeakBidAdapter.js +1 -1
  125. package/dist/relaidoBidAdapter.js +1 -1
  126. package/dist/retailspotBidAdapter.js +1 -1
  127. package/dist/rhythmoneBidAdapter.js +1 -1
  128. package/dist/riseUtils.js +1 -1
  129. package/dist/rubiconBidAdapter.js +1 -1
  130. package/dist/seedingAllianceBidAdapter.js +1 -1
  131. package/dist/seedtagBidAdapter.js +1 -1
  132. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  133. package/dist/sharethroughBidAdapter.js +1 -1
  134. package/dist/showheroes-bsBidAdapter.js +1 -1
  135. package/dist/smaatoBidAdapter.js +1 -1
  136. package/dist/smartadserverBidAdapter.js +1 -1
  137. package/dist/smartxBidAdapter.js +1 -1
  138. package/dist/smilewantedBidAdapter.js +1 -1
  139. package/dist/snigelBidAdapter.js +1 -1
  140. package/dist/sonobiBidAdapter.js +1 -1
  141. package/dist/sovrnBidAdapter.js +1 -1
  142. package/dist/sparteoBidAdapter.js +1 -1
  143. package/dist/sspBCBidAdapter.js +1 -1
  144. package/dist/stvBidAdapter.js +1 -1
  145. package/dist/sublimeBidAdapter.js +1 -1
  146. package/dist/taboolaBidAdapter.js +1 -1
  147. package/dist/tappxBidAdapter.js +1 -1
  148. package/dist/targetVideoBidAdapter.js +1 -1
  149. package/dist/teadsBidAdapter.js +1 -1
  150. package/dist/terceptAnalyticsAdapter.js +1 -1
  151. package/dist/themoneytizerBidAdapter.js +1 -1
  152. package/dist/trionBidAdapter.js +1 -1
  153. package/dist/tripleliftBidAdapter.js +1 -1
  154. package/dist/ttdBidAdapter.js +1 -1
  155. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  156. package/dist/uid2IdSystem.js +1 -1
  157. package/dist/underdogmediaBidAdapter.js +1 -1
  158. package/dist/undertoneBidAdapter.js +1 -1
  159. package/dist/unrulyBidAdapter.js +1 -1
  160. package/dist/vidazooUtils.js +1 -1
  161. package/dist/videobyteBidAdapter.js +1 -1
  162. package/dist/visxBidAdapter.js +1 -1
  163. package/dist/vuukleBidAdapter.js +1 -1
  164. package/dist/widespaceBidAdapter.js +1 -1
  165. package/dist/winrBidAdapter.js +1 -1
  166. package/dist/yahooAdsBidAdapter.js +1 -1
  167. package/dist/yandexBidAdapter.js +1 -1
  168. package/dist/yieldmoBidAdapter.js +1 -1
  169. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  170. package/dist/yieldoneBidAdapter.js +1 -1
  171. package/gulpfile.js +2 -1
  172. package/integrationExamples/gpt/raveltechRtdProvider_example.html +379 -0
  173. package/libraries/braveUtils/index.js +1 -1
  174. package/libraries/riseUtils/index.js +1 -1
  175. package/modules/epomDspBidAdapter.js +177 -0
  176. package/modules/epomDspBidAdapter.md +170 -0
  177. package/modules/equativBidAdapter.js +14 -3
  178. package/modules/goldbachBidAdapter.js +160 -300
  179. package/modules/raveltechRtdProvider.js +131 -0
  180. package/modules/raveltechRtdProvider.md +61 -0
  181. package/modules/seedtagBidAdapter.js +1 -0
  182. package/modules/yandexBidAdapter.js +4 -0
  183. package/modules/yieldoneBidAdapter.js +6 -0
  184. package/package.json +2 -2
  185. package/test/spec/modules/epomDspBidAdapter_spec.js +73 -0
  186. package/test/spec/modules/equativBidAdapter_spec.js +19 -1
  187. package/test/spec/modules/goldbachBidAdapter_spec.js +227 -499
  188. package/test/spec/modules/raveltechRtdProvider_spec.js +108 -0
  189. package/test/spec/modules/seedtagBidAdapter_spec.js +56 -2
  190. package/test/spec/modules/yandexBidAdapter_spec.js +6 -0
  191. package/test/spec/modules/yieldoneBidAdapter_spec.js +40 -0
@@ -1,14 +1,16 @@
1
1
  import { expect } from 'chai';
2
2
  import sinon from 'sinon';
3
- import { spec } from 'modules/goldbachBidAdapter.js';
3
+ import { spec, storage } from 'modules/goldbachBidAdapter.js';
4
4
  import { newBidder } from 'src/adapters/bidderFactory.js';
5
- import { auctionManager } from 'src/auctionManager.js';
6
5
  import { deepClone } from 'src/utils.js';
7
- import { VIDEO } from 'src/mediaTypes.js';
6
+ import { BANNER, VIDEO, NATIVE } from 'src/mediaTypes.js';
7
+ import { OUTSTREAM } from 'src/video.js';
8
+ import { addFPDToBidderRequest } from '../../helpers/fpd.js';
8
9
  import * as ajaxLib from 'src/ajax.js';
9
10
 
10
11
  const BIDDER_NAME = 'goldbach'
11
- const ENDPOINT = 'https://goldlayer-api.prod.gbads.net/bid/pbjs';
12
+ const ENDPOINT = 'https://goldlayer-api.prod.gbads.net/openrtb/2.5/auction';
13
+ const ENDPOINT_COOKIESYNC = 'https://goldlayer-api.prod.gbads.net/cookiesync';
12
14
 
13
15
  /* Eids */
14
16
  let eids = [
@@ -44,7 +46,7 @@ let eids = [
44
46
  }
45
47
  ];
46
48
 
47
- const validNativeAd = {
49
+ const validNativeObject = {
48
50
  link: {
49
51
  url: 'https://example.com/cta',
50
52
  },
@@ -56,7 +58,7 @@ const validNativeAd = {
56
58
  {
57
59
  id: 1,
58
60
  title: {
59
- text: 'Amazing Product - Don’t Miss Out!',
61
+ text: 'Amazing Product - Do not Miss Out!',
60
62
  },
61
63
  },
62
64
  {
@@ -78,62 +80,24 @@ const validNativeAd = {
78
80
  {
79
81
  id: 4,
80
82
  data: {
81
- value: 'This is the description of the product. Its so good youll love it!',
83
+ value: 'This is the description of the product or service being advertised.',
82
84
  },
83
85
  },
84
86
  {
85
87
  id: 5,
86
88
  data: {
87
- value: 'Sponsored by ExampleBrand',
89
+ value: 'Sponsored by some brand',
88
90
  },
89
91
  },
90
92
  {
91
93
  id: 6,
92
94
  data: {
93
- value: 'Shop Now',
95
+ value: 'Buy Now',
94
96
  },
95
97
  },
96
98
  ],
97
99
  };
98
100
 
99
- /* Ortb2 bid information */
100
- let ortb2 = {
101
- device: {
102
- ip: '133.713.371.337',
103
- connectiontype: 6,
104
- w: 1512,
105
- h: 982,
106
- ifa: '23575619-ef35-4908-b468-ffc4000cdf07',
107
- ua: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36',
108
- geo: {lat: 47.318054, lon: 8.582883, zip: '8700'}
109
- },
110
- site: {
111
- domain: 'publisher-page.ch',
112
- page: 'https://publisher-page.ch/home',
113
- publisher: { domain: 'publisher-page.ch' },
114
- ref: 'https://publisher-page.ch/home'
115
- },
116
- user: {
117
- ext: {
118
- eids: eids
119
- }
120
- }
121
- };
122
-
123
- /* Minimal bidderRequest */
124
- let validBidderRequest = {
125
- auctionId: '7570fb24-810d-4c26-9f9c-acd0b6977f60',
126
- start: 1731680672810,
127
- auctionStart: 1731680672808,
128
- ortb2: ortb2,
129
- bidderCode: BIDDER_NAME,
130
- gdprConsent: {
131
- gdprApplies: true,
132
- consentString: 'trust-me-i-consent'
133
- },
134
- timeout: 300
135
- };
136
-
137
101
  /* Minimal validBidRequests */
138
102
  let validBidRequests = [
139
103
  {
@@ -144,9 +108,8 @@ let validBidRequests = [
144
108
  bidId: '3d52a1909b972a',
145
109
  bidderRequestId: '2b63a1826ab946',
146
110
  userIdAsEids: eids,
147
- ortb2: ortb2,
148
111
  mediaTypes: {
149
- banner: {
112
+ [BANNER]: {
150
113
  sizes: [[300, 50], [300, 250], [300, 600], [320, 50], [320, 480], [320, 64], [320, 160], [320, 416], [336, 280]]
151
114
  }
152
115
  },
@@ -154,9 +117,7 @@ let validBidRequests = [
154
117
  params: {
155
118
  publisherId: 'de-publisher.ch-ios',
156
119
  slotId: '/46753895/publisher.ch/inside-full-content-pos1/pbjs-test',
157
- customTargeting: {
158
- language: 'de'
159
- }
120
+ customTargeting: { language: 'de' }
160
121
  }
161
122
  },
162
123
  {
@@ -167,19 +128,17 @@ let validBidRequests = [
167
128
  bidId: '3d52a1909b972b',
168
129
  bidderRequestId: '2b63a1826ab946',
169
130
  userIdAsEids: eids,
170
- ortb2: ortb2,
171
131
  mediaTypes: {
172
- video: {
173
- sizes: [[640, 480]]
132
+ [VIDEO]: {
133
+ playerSize: [[640, 480]],
134
+ context: OUTSTREAM,
135
+ protocols: [1, 2],
136
+ mimes: ['video/mp4']
174
137
  }
175
138
  },
176
- sizes: [[640, 480]],
177
139
  params: {
178
140
  publisherId: 'de-publisher.ch-ios',
179
141
  slotId: '/46753895/publisher.ch/inside-full-content-pos1/pbjs-test/video',
180
- video: {
181
- maxduration: 30,
182
- },
183
142
  customTargeting: {
184
143
  language: 'de'
185
144
  }
@@ -193,9 +152,8 @@ let validBidRequests = [
193
152
  bidId: '3d52a1909b972c',
194
153
  bidderRequestId: '2b63a1826ab946',
195
154
  userIdAsEids: eids,
196
- ortb2: ortb2,
197
155
  mediaTypes: {
198
- native: {
156
+ [NATIVE]: {
199
157
  title: {
200
158
  required: true,
201
159
  len: 50
@@ -232,192 +190,99 @@ let validBidRequests = [
232
190
  }
233
191
  ];
234
192
 
235
- /* Creative request send to server */
236
- let validCreativeRequest = {
237
- mock: false,
238
- debug: false,
239
- timestampStart: 1731680672811,
240
- timestampEnd: 1731680675811,
241
- config: {
242
- publisher: {
243
- id: 'de-20minuten.ch',
244
- },
245
- },
246
- gdpr: {},
247
- contextInfo: {
248
- contentUrl: 'http://127.0.0.1:5500/sample-request.html',
249
- },
250
- appInfo: {
251
- id: '127.0.0.1:5500',
252
- },
253
- userInfo: {
254
- ua: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36',
255
- ifa: '23575619-ef35-4908-b468-ffc4000cdf07',
256
- ppid: [
257
- {
258
- source: 'oneid.live',
259
- id: '0d862e87-14e9-47a4-9e9b-886b7d7a9d1b',
260
- },
261
- {
262
- source: 'goldbach.com',
263
- id: 'aa07ead5044f47bb28894ffa0346ed2c',
264
- },
265
- ],
266
- },
267
- slots: [
268
- {
269
- id: '/46753895/publisher.ch/inside-full-content-pos1/pbjs-test',
270
- sizes: [
271
- [300, 50],
272
- [300, 250],
273
- [300, 600],
274
- [320, 50],
275
- [320, 480],
276
- [320, 64],
277
- [320, 160],
278
- [320, 416],
279
- [336, 280],
280
- ],
281
- targetings: {
282
- gpsenabled: 'false',
283
- fr: 'false',
284
- pagetype: 'story',
285
- darkmode: 'false',
286
- userloggedin: 'false',
287
- iosbuild: '24110',
288
- language: 'de',
289
- storyId: '103211763',
290
- connection: 'wifi',
291
- },
292
- },
293
- {
294
- id: '/46753895/publisher.ch/inside-full-content-pos1/pbjs-test/video',
295
- sizes: [[640, 480]],
296
- targetings: {
297
- gpsenabled: 'false',
298
- fr: 'false',
299
- pagetype: 'story',
300
- darkmode: 'false',
301
- userloggedin: 'false',
302
- iosbuild: '24110',
303
- language: 'de',
304
- storyId: '103211763',
305
- connection: 'wifi',
306
- duration: 'XL',
307
- },
308
- },
309
- ],
310
- targetings: {
311
- long: 8.582883,
312
- lat: 47.318054,
313
- connection: '4G',
314
- zip: '8700',
193
+ /* Minimal bidderRequest */
194
+ let validBidderRequest = {
195
+ bidderCode: BIDDER_NAME,
196
+ auctionId: '7570fb24-810d-4c26-9f9c-acd0b6977f60',
197
+ bidderRequestId: '7570fb24-811d-4c26-9f9c-acd0b6977f61',
198
+ bids: validBidRequests,
199
+ gdprConsent: {
200
+ gdprApplies: true,
201
+ consentString: 'CONSENT'
315
202
  },
203
+ timeout: 3000
316
204
  };
317
205
 
318
- /* Creative response received from server */
319
- let validCreativeResponse = {
320
- creatives: {
321
- '/46753895/publisher.ch/inside-full-content-pos1/pbjs-test': [
322
- {
323
- cpm: 32.2,
324
- currency: 'USD',
325
- width: 1,
326
- height: 1,
327
- creativeId: '1',
328
- ttl: 3600,
329
- mediaType: 'native',
330
- netRevenue: true,
331
- contextType: 'native',
332
- ad: JSON.stringify(validNativeAd),
333
- meta: {
334
- advertiserDomains: ['example.com'],
335
- mediaType: 'native'
336
- }
337
- },
338
- {
339
- cpm: 21.9,
340
- currency: 'USD',
341
- width: 300,
342
- height: 50,
343
- creativeId: '2',
344
- ttl: 3600,
345
- mediaType: 'banner',
346
- netRevenue: true,
347
- contextType: 'banner',
348
- ad: 'banner-ad',
349
- meta: {
350
- advertiserDomains: ['example.com'],
351
- mediaType: 'banner'
352
- }
353
- }
354
- ],
355
- '/46753895/publisher.ch/inside-full-content-pos1/pbjs-test/video': [
356
- {
357
- cpm: 44.2,
358
- currency: 'USD',
359
- width: 1,
360
- height: 1,
361
- creativeId: '3',
362
- ttl: 3600,
363
- mediaType: 'video',
364
- netRevenue: true,
365
- contextType: 'video_preroll',
366
- ad: 'video-ad',
367
- meta: {
368
- advertiserDomains: ['example.com'],
369
- mediaType: 'video'
370
- }
371
- }
372
- ],
373
- '/46753895/publisher.ch/inside-full-content-pos1/pbjs-test/native': [
374
- {
375
- cpm: 10.2,
376
- currency: 'USD',
377
- width: 1,
378
- height: 1,
379
- creativeId: '4',
380
- ttl: 3600,
381
- mediaType: 'native',
382
- netRevenue: true,
383
- contextType: 'native',
384
- ad: JSON.stringify(validNativeAd),
385
- meta: {
386
- advertiserDomains: ['example.com'],
387
- mediaType: 'native'
206
+ /* OpenRTB response from auction endpoint */
207
+ let validOrtbBidResponse = {
208
+ id: '3d52a1909b972a',
209
+ seatbid: [
210
+ {
211
+ bid: [
212
+ {
213
+ id: '3d52a1909b972a',
214
+ impid: '3d52a1909b972a',
215
+ price: 0.5,
216
+ adm: '<div>creative</div>',
217
+ crid: 'creative-id',
218
+ w: 300,
219
+ h: 250,
220
+ ext: {
221
+ origbidcur: 'USD',
222
+ prebid: {
223
+ type: 'banner'
224
+ }
225
+ }
226
+ },
227
+ {
228
+ id: '3d52a1909b972b',
229
+ impid: '3d52a1909b972b',
230
+ price: 0.5,
231
+ adm: '<div>creative</div>',
232
+ crid: 'creative-id',
233
+ w: 640,
234
+ h: 480,
235
+ ext: {
236
+ origbidcur: 'USD',
237
+ prebid: {
238
+ type: 'video'
239
+ }
240
+ }
241
+ },
242
+ {
243
+ id: '3d52a1909b972c',
244
+ impid: '3d52a1909b972c',
245
+ price: 0.5,
246
+ adm: validNativeObject,
247
+ crid: 'creative-id',
248
+ ext: {
249
+ origbidcur: 'USD',
250
+ prebid: {
251
+ type: 'native'
252
+ }
253
+ }
388
254
  }
255
+ ]
256
+ }
257
+ ],
258
+ cur: 'USD',
259
+ ext: {
260
+ prebid: {
261
+ targeting: {
262
+ hb_bidder: 'appnexus',
263
+ hb_pb: '0.50',
264
+ hb_adid: '3d52a1909b972a',
265
+ hb_deal: 'deal-id',
266
+ hb_size: '300x250'
389
267
  }
390
- ],
268
+ }
391
269
  }
392
270
  };
393
271
 
394
- /* composed request */
395
- let validRequest = {
396
- url: ENDPOINT,
397
- method: 'POST',
398
- data: validCreativeRequest,
399
- options: {
400
- contentType: 'application/json',
401
- withCredentials: false
402
- },
403
- bidderRequest: {
404
- ...validBidderRequest,
405
- bids: validBidRequests
406
- }
407
- }
408
-
409
272
  describe('GoldbachBidAdapter', function () {
410
273
  const adapter = newBidder(spec);
274
+ let sandbox;
411
275
  let ajaxStub;
412
276
 
413
277
  beforeEach(() => {
414
- ajaxStub = sinon.stub(ajaxLib, 'ajax');
415
- sinon.stub(Math, 'random').returns(0);
278
+ sandbox = sinon.sandbox.create();
279
+ ajaxStub = sandbox.stub(ajaxLib, 'ajax');
280
+ sandbox.stub(Math, 'random').returns(0);
416
281
  });
417
282
 
418
283
  afterEach(() => {
419
284
  ajaxStub.restore();
420
- Math.random.restore();
285
+ sandbox.restore();
421
286
  });
422
287
 
423
288
  describe('inherited functions', function () {
@@ -431,6 +296,8 @@ describe('GoldbachBidAdapter', function () {
431
296
  bidder: BIDDER_NAME,
432
297
  params: {
433
298
  publisherId: 'de-publisher.ch-ios',
299
+ slotId: '/46753895/publisher.ch/inside-full-content-pos1/pbjs-test',
300
+ customTargeting: { language: 'de' }
434
301
  },
435
302
  adUnitCode: '/46753895/publisher.ch/inside-full-content-pos1/pbjs-test',
436
303
  sizes: [[300, 250], [300, 600]]
@@ -451,322 +318,183 @@ describe('GoldbachBidAdapter', function () {
451
318
  });
452
319
 
453
320
  describe('buildRequests', function () {
454
- let getAdUnitsStub;
455
-
456
- beforeEach(function() {
457
- getAdUnitsStub = sinon.stub(auctionManager, 'getAdUnits').callsFake(function() {
458
- return [];
459
- });
460
- });
461
-
462
- afterEach(function() {
463
- getAdUnitsStub.restore();
464
- });
465
-
466
321
  it('should use defined endpoint', function () {
467
322
  let bidRequests = deepClone(validBidRequests);
468
323
  let bidderRequest = deepClone(validBidderRequest);
469
324
 
470
- const requests = spec.buildRequests(bidRequests, bidderRequest);
471
- expect(requests.length).to.equal(1);
472
- expect(requests[0].url).to.equal(ENDPOINT);
325
+ const request = spec.buildRequests(bidRequests, bidderRequest);
326
+ expect(request.url).to.equal(ENDPOINT);
473
327
  })
474
328
 
475
- it('should parse all bids to valid slots', function () {
329
+ it('should parse all bids to a valid openRTB request', function () {
476
330
  let bidRequests = deepClone(validBidRequests);
477
331
  let bidderRequest = deepClone(validBidderRequest);
478
-
479
- const requests = spec.buildRequests(bidRequests, bidderRequest);
480
- const payload = requests[0].data;
481
-
482
- expect(payload.slots).to.exist;
483
- expect(Array.isArray(payload.slots)).to.be.true;
484
- expect(payload.slots.length).to.equal(3);
485
- expect(payload.slots[0].id).to.equal(bidRequests[0].params.slotId);
486
- expect(Array.isArray(payload.slots[0].sizes)).to.be.true;
487
- expect(payload.slots[0].sizes.length).to.equal(bidRequests[0].sizes.length);
488
- expect(payload.slots[1].id).to.equal(bidRequests[1].params.slotId);
489
- expect(Array.isArray(payload.slots[1].sizes)).to.be.true;
332
+ const request = spec.buildRequests(bidRequests, bidderRequest);
333
+ const payload = request.data;
334
+
335
+ expect(payload.imp).to.exist;
336
+ expect(Array.isArray(payload.imp)).to.be.true;
337
+ expect(payload.imp.length).to.equal(3);
338
+ expect(payload.imp[0].ext.goldbach.slotId).to.equal(bidRequests[0].params.slotId);
339
+ expect(Array.isArray(payload.imp[0][BANNER].format)).to.be.true;
340
+ expect(payload.imp[0][BANNER].format.length).to.equal(bidRequests[0].sizes.length);
341
+ expect(payload.imp[1].ext.goldbach.slotId).to.equal(bidRequests[1].params.slotId);
490
342
  });
491
343
 
492
- it('should parse all video bids to valid video slots (use video sizes)', function () {
493
- let bidRequests = validBidRequests.map(request => Object.assign({}, []));
494
- let bidderRequest = deepClone(validBidderRequest);
495
-
496
- const requests = spec.buildRequests([{
497
- ...bidRequests[1],
498
- sizes: [],
499
- mediaTypes: {
500
- [VIDEO]: {
501
- sizes: [[640, 480]]
502
- }
503
- }
504
- }], bidderRequest);
505
- const payload = requests[0].data;
506
-
507
- expect(payload.slots.length).to.equal(1);
508
- expect(payload.slots[0].sizes.length).to.equal(1);
509
- expect(payload.slots[0].sizes[0][0]).to.equal(640);
510
- expect(payload.slots[0].sizes[0][1]).to.equal(480);
511
- });
512
-
513
- it('should set timestamps on request', function () {
514
- let bidRequests = deepClone(validBidRequests);
515
- let bidderRequest = deepClone(validBidderRequest);
516
-
517
- const requests = spec.buildRequests(bidRequests, bidderRequest);
518
- const payload = requests[0].data;
519
-
520
- expect(payload.timestampStart).to.exist;
521
- expect(payload.timestampStart).to.be.greaterThan(1)
522
- expect(payload.timestampEnd).to.exist;
523
- expect(payload.timestampEnd).to.be.greaterThan(1)
524
- });
525
-
526
- it('should set config on request', function () {
527
- let bidRequests = deepClone(validBidRequests);
528
- let bidderRequest = deepClone(validBidderRequest);
529
-
530
- const requests = spec.buildRequests(bidRequests, bidderRequest);
531
- const payload = requests[0].data;
532
-
533
- expect(payload.config.publisher.id).to.equal(bidRequests[0].params.publisherId);
534
- });
344
+ if (FEATURES.VIDEO) {
345
+ it('should parse all video bids to valid video imps (use video player size)', async function () {
346
+ let bidRequests = deepClone(validBidRequests);
347
+ let bidderRequest = deepClone(validBidderRequest);
348
+ const request = spec.buildRequests([bidRequests[1]], await addFPDToBidderRequest(bidderRequest));
349
+ const payload = request.data;
350
+
351
+ expect(payload.imp.length).to.equal(1);
352
+ expect(payload.imp[0][VIDEO]).to.exist;
353
+ expect(payload.imp[0][VIDEO].w).to.equal(640);
354
+ expect(payload.imp[0][VIDEO].h).to.equal(480);
355
+ });
356
+ }
535
357
 
536
- it('should set config on request', function () {
358
+ it('should set custom config on request', function () {
537
359
  let bidRequests = deepClone(validBidRequests);
538
360
  let bidderRequest = deepClone(validBidderRequest);
361
+ const request = spec.buildRequests(bidRequests, bidderRequest);
362
+ const payload = request.data;
539
363
 
540
- const requests = spec.buildRequests(bidRequests, bidderRequest);
541
- const payload = requests[0].data;
542
-
543
- expect(payload.config.publisher.id).to.equal(bidRequests[0].params.publisherId);
364
+ expect(payload.ext.goldbach.publisherId).to.equal(bidRequests[0].params.publisherId);
544
365
  });
545
366
 
546
367
  it('should set gdpr on request', function () {
547
368
  let bidRequests = deepClone(validBidRequests);
548
369
  let bidderRequest = deepClone(validBidderRequest);
370
+ const request = spec.buildRequests(bidRequests, bidderRequest);
371
+ const payload = request.data;
549
372
 
550
- const requests = spec.buildRequests(bidRequests, bidderRequest);
551
- const payload = requests[0].data;
552
-
553
- expect(payload.gdpr).to.exist;
554
- expect(payload.gdpr.consent).to.equal(bidderRequest.gdprConsent.gdprApplies);
555
- expect(payload.gdpr.consentString).to.equal(bidderRequest.gdprConsent.consentString);
373
+ expect(!!payload.regs.ext.gdpr).to.equal(bidderRequest.gdprConsent.gdprApplies);
374
+ expect(payload.user.ext.consent).to.equal(bidderRequest.gdprConsent.consentString);
556
375
  });
557
376
 
558
- it('should set contextInfo on request', function () {
377
+ it('should set custom targeting on request', function () {
559
378
  let bidRequests = deepClone(validBidRequests);
560
379
  let bidderRequest = deepClone(validBidderRequest);
380
+ const request = spec.buildRequests(bidRequests, bidderRequest);
381
+ const payload = request.data;
561
382
 
562
- const requests = spec.buildRequests(bidRequests, bidderRequest);
563
- const payload = requests[0].data;
564
-
565
- expect(payload.contextInfo.contentUrl).to.exist;
566
- expect(payload.contextInfo.contentUrl).to.equal(bidderRequest.ortb2.site.page);
383
+ expect(payload.imp[0].ext.goldbach.targetings).to.exist;
384
+ expect(payload.imp[0].ext.goldbach.targetings).to.deep.equal(bidRequests[0].params.customTargeting);
567
385
  });
386
+ });
568
387
 
569
- it('should set appInfo on request', function () {
570
- let bidRequests = deepClone(validBidRequests);
571
- let bidderRequest = deepClone(validBidderRequest);
572
-
573
- const requests = spec.buildRequests(bidRequests, bidderRequest);
574
- const payload = requests[0].data;
388
+ describe('interpretResponse', function () {
389
+ it('should map response to valid bids (amount)', function () {
390
+ let bidRequest = spec.buildRequests(validBidRequests, validBidderRequest);
391
+ let bidResponse = deepClone({body: validOrtbBidResponse});
392
+ const response = spec.interpretResponse(bidResponse, bidRequest);
575
393
 
576
- expect(payload.appInfo.id).to.exist;
577
- expect(payload.appInfo.id).to.equal(bidderRequest.ortb2.site.domain);
394
+ expect(response).to.exist;
395
+ expect(response.length).to.equal(3);
396
+ expect(response.filter(bid => bid.requestId === validBidRequests[0].bidId).length).to.equal(1)
397
+ expect(response.filter(bid => bid.requestId === validBidRequests[1].bidId).length).to.equal(1)
578
398
  });
579
399
 
580
- it('should set userInfo on request', function () {
581
- let bidRequests = deepClone(validBidRequests);
582
- let bidderRequest = deepClone(validBidderRequest);
583
-
584
- const requests = spec.buildRequests(bidRequests, bidderRequest);
585
- const payload = requests[0].data;
400
+ if (FEATURES.VIDEO) {
401
+ it('should attach a custom video renderer ', function () {
402
+ let bidRequest = spec.buildRequests(validBidRequests, validBidderRequest);
403
+ let bidResponse = deepClone({body: validOrtbBidResponse});
404
+ bidResponse.body.seatbid[0].bid[1].adm = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><VAST version=\"4.0\"></VAST>';
405
+ bidResponse.body.seatbid[0].bid[1].ext = { prebid: { type: 'video', meta: { type: 'video_outstream' } } };
406
+ const response = spec.interpretResponse(bidResponse, bidRequest);
586
407
 
587
- expect(payload.userInfo).to.exist;
588
- expect(payload.userInfo.ua).to.equal(bidderRequest.ortb2.device.ua);
589
- expect(payload.userInfo.ip).to.equal(bidderRequest.ortb2.device.ip);
590
- expect(payload.userInfo.ifa).to.equal(bidderRequest.ortb2.device.ifa);
591
- expect(Array.isArray(payload.userInfo.ppid)).to.be.true;
592
- expect(payload.userInfo.ppid.length).to.equal(2);
593
- });
408
+ expect(response).to.exist;
409
+ expect(response.filter(bid => !!bid.renderer).length).to.equal(1);
410
+ });
594
411
 
595
- it('should set mapped general targetings on request', function () {
596
- let bidRequests = deepClone(validBidRequests);
597
- let bidderRequest = deepClone(validBidderRequest);
412
+ it('should set the player accordingly to config', function () {
413
+ let bidRequest = spec.buildRequests(validBidRequests, validBidderRequest);
414
+ let bidResponse = deepClone({body: validOrtbBidResponse});
415
+ bidResponse.body.seatbid[0].bid[1].adm = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><VAST version=\"4.0\"></VAST>';
416
+ bidResponse.body.seatbid[0].bid[1].ext = { prebid: { type: 'video', meta: { type: 'video_outstream' } } };
417
+ validBidRequests[1].mediaTypes.video.playbackmethod = 1;
418
+ const response = spec.interpretResponse(bidResponse, bidRequest);
419
+ const renderer = response.find(bid => !!bid.renderer);
420
+ renderer?.renderer?.render();
421
+
422
+ expect(response).to.exist;
423
+ expect(response.filter(bid => !!bid.renderer).length).to.equal(1);
424
+ expect(renderer.renderer.config.documentResolver).to.exist;
425
+ });
426
+ }
598
427
 
599
- const requests = spec.buildRequests(bidRequests, bidderRequest);
600
- const payload = requests[0].data;
428
+ it('should not attach a custom video renderer when VAST url/xml is missing', function () {
429
+ let bidRequest = spec.buildRequests(validBidRequests, validBidderRequest);
430
+ let bidResponse = deepClone({body: validOrtbBidResponse});
431
+ bidResponse.body.seatbid[0].bid[1].adm = undefined;
432
+ bidResponse.body.seatbid[0].bid[1].ext = { prebid: { type: 'video', meta: { type: 'video_outstream' } } };
433
+ const response = spec.interpretResponse(bidResponse, bidRequest);
601
434
 
602
- expect(payload.slots[0].targetings['duration']).to.not.exist;
603
- expect(payload.slots[1].targetings['duration']).to.exist;
604
- expect(payload.targetings['duration']).to.not.exist;
605
- expect(payload.targetings['lat']).to.exist;
606
- expect(payload.targetings['long']).to.exist;
607
- expect(payload.targetings['zip']).to.exist;
608
- expect(payload.targetings['connection']).to.exist;
435
+ expect(response).to.exist;
436
+ expect(response.filter(bid => !!bid.renderer).length).to.equal(0);
609
437
  });
438
+ });
610
439
 
611
- it('should set mapped video duration targetings on request', function () {
612
- let bidRequests = deepClone(validBidRequests);
613
- let videoRequest = deepClone(validBidRequests[1]);
614
- let bidderRequest = deepClone(validBidderRequest);
615
-
616
- bidRequests.push({
617
- ...videoRequest,
618
- params: {
619
- ...videoRequest.params,
620
- video: {
621
- maxduration: 10
440
+ describe('getUserSyncs', function () {
441
+ it('user-syncs with enabled pixel option', function () {
442
+ let gdprConsent = {
443
+ vendorData: {
444
+ purpose: {
445
+ consents: 1
622
446
  }
623
- }
624
- })
625
-
626
- bidRequests.push({
627
- ...videoRequest,
628
- params: {
629
- ...videoRequest.params,
630
- video: {
631
- maxduration: 35
632
- }
633
- }
634
- })
635
-
636
- const requests = spec.buildRequests(bidRequests, bidderRequest);
637
- const payload = requests[0].data;
638
-
639
- expect(payload.slots[0].targetings['duration']).to.not.exist;
640
- expect(payload.slots[1].targetings['duration']).to.exist;
641
- expect(payload.slots[1].targetings['duration']).to.equal('XL');
642
- expect(payload.slots[3].targetings['duration']).to.equal('M');
643
- expect(payload.slots[4].targetings['duration']).to.equal('XXL');
644
- });
645
-
646
- it('should set mapped connection targetings on request', function () {
647
- let bidRequests = deepClone(validBidRequests);
648
- let bidderRequest = deepClone(validBidderRequest);
649
-
650
- const bidderRequestEthernet = deepClone(bidderRequest);
651
- bidderRequestEthernet.ortb2.device.connectiontype = 1;
652
- const payloadEthernet = spec.buildRequests(bidRequests, bidderRequestEthernet)[0].data;
653
-
654
- const bidderRequestWifi = deepClone(bidderRequest);
655
- bidderRequestWifi.ortb2.device.connectiontype = 2;
656
- const payloadWifi = spec.buildRequests(bidRequests, bidderRequestWifi)[0].data;
657
-
658
- const bidderRequest2G = deepClone(bidderRequest);
659
- bidderRequest2G.ortb2.device.connectiontype = 4;
660
- const payload2G = spec.buildRequests(bidRequests, bidderRequest2G)[0].data;
661
-
662
- const bidderRequest3G = deepClone(bidderRequest);
663
- bidderRequest3G.ortb2.device.connectiontype = 5;
664
- const payload3G = spec.buildRequests(bidRequests, bidderRequest3G)[0].data;
447
+ }};
448
+ let synOptions = {pixelEnabled: true, iframeEnabled: true};
449
+ const userSyncs = spec.getUserSyncs(synOptions, {}, gdprConsent, {});
665
450
 
666
- const bidderRequest4G = deepClone(bidderRequest);
667
- bidderRequest4G.ortb2.device.connectiontype = 6;
668
- const payload4G = spec.buildRequests(bidRequests, bidderRequest4G)[0].data;
669
-
670
- const bidderRequestNoConnection = deepClone(bidderRequest);
671
- bidderRequestNoConnection.ortb2.device.connectiontype = undefined;
672
- const payloadNoConnection = spec.buildRequests(bidRequests, bidderRequestNoConnection)[0].data;
673
-
674
- expect(payloadEthernet.targetings['connection']).to.equal('ethernet');
675
- expect(payloadWifi.targetings['connection']).to.equal('wifi');
676
- expect(payload2G.targetings['connection']).to.equal('2G');
677
- expect(payload3G.targetings['connection']).to.equal('3G');
678
- expect(payload4G.targetings['connection']).to.equal('4G');
679
- expect(payloadNoConnection.targetings['connection']).to.equal(undefined);
680
- });
451
+ expect(userSyncs[0].type).to.equal('image');
452
+ expect(userSyncs[0].url).to.contain(`https://ib.adnxs.com/getuid?${ENDPOINT_COOKIESYNC}`);
453
+ expect(userSyncs[0].url).to.contain('xandrId=$UID');
454
+ })
681
455
 
682
- it('should create a request with minimal information', function () {
683
- let bidderRequest = Object.assign({}, validBidderRequest);
684
- let bidRequests = validBidRequests.map(request => Object.assign({}, request));
685
-
686
- // Removing usable bidderRequest values
687
- bidderRequest.gdprConsent = undefined;
688
- bidderRequest.ortb2.device.connectiontype = undefined;
689
- bidderRequest.ortb2.device.geo = undefined;
690
- bidderRequest.ortb2.device.ip = undefined;
691
- bidderRequest.ortb2.device.ifa = undefined;
692
- bidderRequest.ortb2.device.ua = undefined;
693
-
694
- // Removing usable bidRequests values
695
- bidRequests = bidRequests.map(request => {
696
- request.ortb2.device.connectiontype = undefined;
697
- request.ortb2.device.geo = undefined;
698
- request.ortb2.device.ip = undefined;
699
- request.ortb2.device.ifa = undefined;
700
- request.ortb2.device.ua = undefined;
701
- request.userIdAsEids = undefined;
702
- request.params = {
703
- publisherId: 'de-publisher.ch-ios'
704
- };
705
- return request;
706
- });
456
+ it('user-syncs with enabled iframe option', function () {
457
+ let gdprConsent = {
458
+ vendorData: {
459
+ purpose: {
460
+ consents: 1
461
+ }
462
+ }};
463
+ let synOptions = {iframeEnabled: true};
464
+ const userSyncs = spec.getUserSyncs(synOptions, {}, gdprConsent, {});
707
465
 
708
- const requests = spec.buildRequests(bidRequests, bidderRequest);
709
- const payload = requests[0].data;
710
-
711
- // bidderRequest mappings
712
- expect(payload.gdpr).to.exist;
713
- expect(payload.gdpr.consent).to.not.exist;
714
- expect(payload.gdpr.consentString).to.not.exist;
715
- expect(payload.userInfo).to.exist;
716
- expect(payload.userInfo.ua).to.exist;
717
- expect(payload.userInfo.ip).to.not.exist;
718
- expect(payload.userInfo.ifa).to.not.exist;
719
- expect(payload.userInfo.ppid.length).to.equal(0);
720
- expect(payload.targetings).to.exist;
721
- expect(payload.targetings['connection']).to.not.exist;
722
- expect(payload.targetings['lat']).to.not.exist;
723
- expect(payload.targetings['long']).to.not.exist;
724
- expect(payload.targetings['zip']).to.not.exist;
725
-
726
- // bidRequests mapping
727
- expect(payload.slots).to.exist;
728
- expect(payload.slots.length).to.equal(3);
729
- expect(payload.slots[0].targetings).to.exist
730
- expect(payload.slots[1].targetings).to.exist
731
- });
466
+ expect(userSyncs[0].type).to.equal('iframe');
467
+ expect(userSyncs[0].url).to.contain(`https://ib.adnxs.com/getuid?${ENDPOINT_COOKIESYNC}`);
468
+ expect(userSyncs[0].url).to.contain('xandrId=$UID');
469
+ })
732
470
  });
733
471
 
734
- describe('interpretResponse', function () {
735
- it('should map response to valid bids (amount)', function () {
736
- let request = deepClone(validRequest);
737
- let bidResponse = deepClone({body: validCreativeResponse});
738
-
739
- const response = spec.interpretResponse(bidResponse, request);
740
-
741
- expect(response).to.exist;
742
- expect(response.length).to.equal(3);
743
- expect(response.filter(bid => bid.requestId === validBidRequests[0].bidId).length).to.equal(1)
744
- expect(response.filter(bid => bid.requestId === validBidRequests[1].bidId).length).to.equal(1)
472
+ describe('getUserSyncs storage', function () {
473
+ beforeEach(function () {
474
+ sandbox.stub(storage, 'setDataInLocalStorage');
475
+ sandbox.stub(storage, 'setCookie');
745
476
  });
746
477
 
747
- it('should attach a custom video renderer ', function () {
748
- let request = deepClone(validRequest);
749
- let bidResponse = deepClone({body: validCreativeResponse});
750
- bidResponse.body.creatives[validBidRequests[1].params.slotId][0].mediaType = 'video';
751
- bidResponse.body.creatives[validBidRequests[1].params.slotId][0].vastXml = '<VAST></VAST>';
752
- bidResponse.body.creatives[validBidRequests[1].params.slotId][0].contextType = 'video_outstream';
753
-
754
- const response = spec.interpretResponse(bidResponse, request);
755
-
756
- expect(response).to.exist;
757
- expect(response.filter(bid => !!bid.renderer).length).to.equal(1);
478
+ afterEach(function () {
479
+ sandbox.restore();
758
480
  });
759
481
 
760
- it('should not attach a custom video renderer when VAST url/xml is missing', function () {
761
- let request = deepClone(validRequest);
762
- let bidResponse = deepClone({body: validCreativeResponse});
763
- bidResponse.body.creatives[validBidRequests[1].params.slotId][0].mediaType = 'video';
764
- bidResponse.body.creatives[validBidRequests[1].params.slotId][0].contextType = 'video_outstream';
765
-
766
- const response = spec.interpretResponse(bidResponse, request);
482
+ it('should retrieve a uid in userSync call from localStorage', function () {
483
+ sandbox.stub(storage, 'localStorageIsEnabled').callsFake(() => true);
484
+ sandbox.stub(storage, 'getDataFromLocalStorage').callsFake((key) => 'goldbach_uid');
485
+ const gdprConsent = { vendorData: { purpose: { consents: 1 } } };
486
+ const syncOptions = { iframeEnabled: true };
487
+ const userSyncs = spec.getUserSyncs(syncOptions, {}, gdprConsent, {});
488
+ expect(userSyncs[0].url).to.contain('goldbach_uid');
489
+ });
767
490
 
768
- expect(response).to.exist;
769
- expect(response.filter(bid => !!bid.renderer).length).to.equal(0);
491
+ it('should retrieve a uid in userSync call from cookie', function () {
492
+ sandbox.stub(storage, 'cookiesAreEnabled').callsFake(() => true);
493
+ sandbox.stub(storage, 'getCookie').callsFake((key) => 'goldbach_uid');
494
+ const gdprConsent = { vendorData: { purpose: { consents: 1 } } };
495
+ const syncOptions = { iframeEnabled: true };
496
+ const userSyncs = spec.getUserSyncs(syncOptions, {}, gdprConsent, {});
497
+ expect(userSyncs[0].url).to.contain('goldbach_uid');
770
498
  });
771
499
  });
772
500