prebid.js 8.4.0 → 8.5.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 (285) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -1
  3. package/dist/a1MediaRtdProvider.js +1 -0
  4. package/dist/adagioBidAdapter.js +1 -1
  5. package/dist/adbookpspBidAdapter.js +1 -1
  6. package/dist/adfBidAdapter.js +1 -1
  7. package/dist/adgenerationBidAdapter.js +1 -1
  8. package/dist/adkernelAdnBidAdapter.js +1 -1
  9. package/dist/adkernelBidAdapter.js +1 -1
  10. package/dist/admixerIdSystem.js +1 -1
  11. package/dist/adnuntiusBidAdapter.js +1 -1
  12. package/dist/adqueryBidAdapter.js +1 -1
  13. package/dist/adqueryIdSystem.js +1 -1
  14. package/dist/adrelevantisBidAdapter.js +1 -1
  15. package/dist/adtelligentIdSystem.js +1 -1
  16. package/dist/adtrgtmeBidAdapter.js +1 -1
  17. package/dist/adxcgBidAdapter.js +1 -1
  18. package/dist/adyoulikeBidAdapter.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/appierAnalyticsAdapter.js +1 -1
  23. package/dist/appnexusBidAdapter.js +1 -1
  24. package/dist/asoBidAdapter.js +1 -1
  25. package/dist/axonixBidAdapter.js +1 -1
  26. package/dist/beachfrontBidAdapter.js +1 -1
  27. package/dist/bidglassBidAdapter.js +1 -1
  28. package/dist/big-richmediaBidAdapter.js +1 -1
  29. package/dist/bridBidAdapter.js +1 -1
  30. package/dist/bridgewellBidAdapter.js +1 -1
  31. package/dist/brightMountainMediaBidAdapter.js +1 -1
  32. package/dist/britepoolIdSystem.js +1 -1
  33. package/dist/carodaBidAdapter.js +1 -1
  34. package/dist/chtnwBidAdapter.js +1 -1
  35. package/dist/concertBidAdapter.js +1 -1
  36. package/dist/connectIdSystem.js +1 -1
  37. package/dist/connectadBidAdapter.js +1 -1
  38. package/dist/consentManagementGpp.js +1 -1
  39. package/dist/consumableBidAdapter.js +1 -1
  40. package/dist/conversantAnalyticsAdapter.js +1 -1
  41. package/dist/conversantBidAdapter.js +1 -1
  42. package/dist/craftBidAdapter.js +1 -1
  43. package/dist/criteoBidAdapter.js +1 -1
  44. package/dist/criteoIdSystem.js +1 -1
  45. package/dist/cwireBidAdapter.js +1 -1
  46. package/dist/czechAdIdSystem.js +1 -1
  47. package/dist/dacIdSystem.js +1 -1
  48. package/dist/deepintentDpesIdSystem.js +1 -1
  49. package/dist/dependencies.json +3 -0
  50. package/dist/dmdIdSystem.js +1 -1
  51. package/dist/dspxBidAdapter.js +1 -1
  52. package/dist/eplanningBidAdapter.js +1 -1
  53. package/dist/euidIdSystem.js +1 -1
  54. package/dist/fabrickIdSystem.js +1 -1
  55. package/dist/feedadBidAdapter.js +1 -1
  56. package/dist/finativeBidAdapter.js +1 -1
  57. package/dist/freewheel-sspBidAdapter.js +1 -1
  58. package/dist/ftrackIdSystem.js +1 -1
  59. package/dist/geolocationRtdProvider.js +1 -0
  60. package/dist/gmosspBidAdapter.js +1 -1
  61. package/dist/goldbachBidAdapter.js +1 -1
  62. package/dist/gravitoIdSystem.js +1 -1
  63. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  64. package/dist/greenbidsRtdProvider.js +1 -1
  65. package/dist/gridBidAdapter.js +1 -1
  66. package/dist/growthCodeIdSystem.js +1 -1
  67. package/dist/gumgumBidAdapter.js +1 -1
  68. package/dist/h12mediaBidAdapter.js +1 -1
  69. package/dist/hadronIdSystem.js +1 -1
  70. package/dist/hypelabBidAdapter.js +1 -1
  71. package/dist/id5IdSystem.js +1 -1
  72. package/dist/identityLinkIdSystem.js +1 -1
  73. package/dist/idxIdSystem.js +1 -1
  74. package/dist/imdsBidAdapter.js +1 -1
  75. package/dist/improvedigitalBidAdapter.js +1 -1
  76. package/dist/imuIdSystem.js +1 -1
  77. package/dist/insticatorBidAdapter.js +1 -1
  78. package/dist/intentIqIdSystem.js +1 -1
  79. package/dist/invibesBidAdapter.js +1 -1
  80. package/dist/ixBidAdapter.js +1 -1
  81. package/dist/justIdSystem.js +1 -1
  82. package/dist/justpremiumBidAdapter.js +1 -1
  83. package/dist/kargoBidAdapter.js +1 -1
  84. package/dist/kinessoIdSystem.js +1 -1
  85. package/dist/konduitAnalyticsAdapter.js +1 -1
  86. package/dist/kueezBidAdapter.js +1 -1
  87. package/dist/kueezRtbBidAdapter.js +1 -1
  88. package/dist/kulturemediaBidAdapter.js +1 -1
  89. package/dist/lassoBidAdapter.js +1 -1
  90. package/dist/lifestreetBidAdapter.js +1 -1
  91. package/dist/liveIntentIdSystem.js +1 -1
  92. package/dist/logicadBidAdapter.js +1 -1
  93. package/dist/loglyliftBidAdapter.js +1 -1
  94. package/dist/lotamePanoramaIdSystem.js +1 -1
  95. package/dist/magniteAnalyticsAdapter.js +1 -1
  96. package/dist/malltvAnalyticsAdapter.js +1 -1
  97. package/dist/marsmediaBidAdapter.js +1 -1
  98. package/dist/mediafuseBidAdapter.js +1 -1
  99. package/dist/mediasquareBidAdapter.js +1 -1
  100. package/dist/merkleIdSystem.js +1 -1
  101. package/dist/mgidBidAdapter.js +1 -1
  102. package/dist/minutemediaBidAdapter.js +1 -1
  103. package/dist/minutemediaplusBidAdapter.js +1 -1
  104. package/dist/mwOpenLinkIdSystem.js +1 -1
  105. package/dist/naveggIdSystem.js +1 -1
  106. package/dist/netIdSystem.js +1 -1
  107. package/dist/nexx360BidAdapter.js +1 -1
  108. package/dist/not-for-prod/prebid.js +176 -173
  109. package/dist/novatiqIdSystem.js +1 -1
  110. package/dist/oguryBidAdapter.js +1 -1
  111. package/dist/oneKeyIdSystem.js +1 -1
  112. package/dist/onetagBidAdapter.js +1 -1
  113. package/dist/ooloAnalyticsAdapter.js +1 -1
  114. package/dist/optidigitalBidAdapter.js +1 -1
  115. package/dist/outbrainBidAdapter.js +1 -1
  116. package/dist/ozoneBidAdapter.js +1 -1
  117. package/dist/pairIdSystem.js +1 -1
  118. package/dist/parrableIdSystem.js +1 -1
  119. package/dist/pixfutureBidAdapter.js +1 -1
  120. package/dist/prebid-core.js +1 -1
  121. package/dist/publinkIdSystem.js +1 -1
  122. package/dist/pubmaticBidAdapter.js +1 -1
  123. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  124. package/dist/pxyzBidAdapter.js +1 -1
  125. package/dist/quantcastBidAdapter.js +1 -1
  126. package/dist/quantcastIdSystem.js +1 -1
  127. package/dist/readpeakBidAdapter.js +1 -1
  128. package/dist/relaidoBidAdapter.js +1 -1
  129. package/dist/retailspotBidAdapter.js +1 -1
  130. package/dist/rhythmoneBidAdapter.js +1 -1
  131. package/dist/riseBidAdapter.js +1 -1
  132. package/dist/rubiconBidAdapter.js +1 -1
  133. package/dist/seedingAllianceBidAdapter.js +1 -1
  134. package/dist/seedtagBidAdapter.js +1 -1
  135. package/dist/sharedIdSystem.js +1 -1
  136. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  137. package/dist/sharethroughBidAdapter.js +1 -1
  138. package/dist/shinezBidAdapter.js +1 -1
  139. package/dist/silverpushBidAdapter.js +1 -1
  140. package/dist/smaatoBidAdapter.js +1 -1
  141. package/dist/smartadserverBidAdapter.js +1 -1
  142. package/dist/smartxBidAdapter.js +1 -1
  143. package/dist/smilewantedBidAdapter.js +1 -1
  144. package/dist/sonobiBidAdapter.js +1 -1
  145. package/dist/sovrnAnalyticsAdapter.js +1 -1
  146. package/dist/sovrnBidAdapter.js +1 -1
  147. package/dist/ssmasBidAdapter.js +1 -0
  148. package/dist/sspBCBidAdapter.js +1 -1
  149. package/dist/stvBidAdapter.js +1 -1
  150. package/dist/sublimeBidAdapter.js +1 -1
  151. package/dist/tapadIdSystem.js +1 -1
  152. package/dist/targetVideoBidAdapter.js +1 -1
  153. package/dist/teadsBidAdapter.js +1 -1
  154. package/dist/tncIdSystem.js +1 -1
  155. package/dist/trionBidAdapter.js +1 -1
  156. package/dist/tripleliftBidAdapter.js +1 -1
  157. package/dist/ttdBidAdapter.js +1 -1
  158. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  159. package/dist/uid2IdSystem.js +1 -1
  160. package/dist/underdogmediaBidAdapter.js +1 -1
  161. package/dist/undertoneBidAdapter.js +1 -1
  162. package/dist/unifiedIdSystem.js +1 -1
  163. package/dist/userId.js +1 -1
  164. package/dist/utiqSystem.js +1 -1
  165. package/dist/verizonMediaIdSystem.js +1 -1
  166. package/dist/vidazooBidAdapter.js +1 -1
  167. package/dist/videobyteBidAdapter.js +1 -1
  168. package/dist/visxBidAdapter.js +1 -1
  169. package/dist/vrtcalBidAdapter.js +1 -1
  170. package/dist/vuukleBidAdapter.js +1 -1
  171. package/dist/widespaceBidAdapter.js +1 -1
  172. package/dist/winrBidAdapter.js +1 -1
  173. package/dist/yahoosspBidAdapter.js +1 -1
  174. package/dist/yieldmoBidAdapter.js +1 -1
  175. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  176. package/dist/zeotapIdPlusIdSystem.js +1 -1
  177. package/integrationExamples/gpt/adUnitFloors.html +0 -1
  178. package/modules/.submodules.json +1 -0
  179. package/modules/33acrossIdSystem.js +9 -0
  180. package/modules/a1MediaRtdProvider.js +92 -0
  181. package/modules/a1MediaRtdProvider.md +46 -0
  182. package/modules/adfBidAdapter.js +4 -1
  183. package/modules/adkernelAdnBidAdapter.js +1 -1
  184. package/modules/adkernelBidAdapter.js +10 -3
  185. package/modules/admixerIdSystem.js +6 -0
  186. package/modules/adnuntiusBidAdapter.js +5 -13
  187. package/modules/adqueryIdSystem.js +6 -0
  188. package/modules/adtelligentIdSystem.js +6 -0
  189. package/modules/adyoulikeBidAdapter.js +6 -3
  190. package/modules/amxIdSystem.js +6 -0
  191. package/modules/beachfrontBidAdapter.js +32 -6
  192. package/modules/britepoolIdSystem.js +6 -0
  193. package/modules/connectIdSystem.js +6 -0
  194. package/modules/consentManagementGpp.js +10 -1
  195. package/modules/consumableBidAdapter.js +9 -1
  196. package/modules/criteoIdSystem.js +6 -0
  197. package/modules/czechAdIdSystem.js +6 -0
  198. package/modules/dacIdSystem.js +6 -0
  199. package/modules/deepintentDpesIdSystem.js +7 -2
  200. package/modules/dmdIdSystem.js +6 -0
  201. package/modules/euidIdSystem.js +9 -0
  202. package/modules/fabrickIdSystem.js +6 -0
  203. package/modules/ftrackIdSystem.js +16 -0
  204. package/modules/geolocationRtdProvider.js +65 -0
  205. package/modules/gravitoIdSystem.js +6 -0
  206. package/modules/greenbidsRtdProvider.js +1 -1
  207. package/modules/growthCodeIdSystem.js +20 -1
  208. package/modules/hadronIdSystem.js +6 -0
  209. package/modules/id5IdSystem.js +34 -8
  210. package/modules/identityLinkIdSystem.js +6 -0
  211. package/modules/idxIdSystem.js +6 -0
  212. package/modules/imdsBidAdapter.js +38 -14
  213. package/modules/imuIdSystem.js +10 -0
  214. package/modules/intentIqIdSystem.js +6 -0
  215. package/modules/invibesBidAdapter.js +5 -5
  216. package/modules/ixBidAdapter.js +16 -0
  217. package/modules/justIdSystem.js +6 -0
  218. package/modules/kinessoIdSystem.js +7 -2
  219. package/modules/liveIntentIdSystem.js +53 -0
  220. package/modules/lotamePanoramaIdSystem.js +6 -0
  221. package/modules/merkleIdSystem.js +24 -0
  222. package/modules/mwOpenLinkIdSystem.js +6 -0
  223. package/modules/naveggIdSystem.js +6 -0
  224. package/modules/netIdSystem.js +6 -0
  225. package/modules/novatiqIdSystem.js +12 -0
  226. package/modules/oneKeyIdSystem.js +26 -0
  227. package/modules/ozoneBidAdapter.js +65 -18
  228. package/modules/ozoneBidAdapter.md +3 -1
  229. package/modules/pairIdSystem.js +6 -0
  230. package/modules/parrableIdSystem.js +38 -2
  231. package/modules/publinkIdSystem.js +7 -1
  232. package/modules/quantcastIdSystem.js +6 -0
  233. package/modules/rubiconBidAdapter.js +9 -0
  234. package/modules/sharedIdSystem.js +6 -0
  235. package/modules/silverpushBidAdapter.js +2 -2
  236. package/modules/ssmasBidAdapter.js +126 -0
  237. package/modules/ssmasBidAdapter.md +35 -0
  238. package/modules/sspBCBidAdapter.js +36 -13
  239. package/modules/tapadIdSystem.js +6 -0
  240. package/modules/tncIdSystem.js +6 -0
  241. package/modules/tripleliftBidAdapter.js +5 -0
  242. package/modules/uid2IdSystem.js +14 -0
  243. package/modules/unifiedIdSystem.js +11 -0
  244. package/modules/userId/eids.js +6 -445
  245. package/modules/userId/index.js +36 -24
  246. package/modules/utiqSystem.js +9 -0
  247. package/modules/verizonMediaIdSystem.js +6 -0
  248. package/modules/vrtcalBidAdapter.js +10 -6
  249. package/modules/zeotapIdPlusIdSystem.js +6 -0
  250. package/package.json +1 -1
  251. package/src/adapters/bidderFactory.js +15 -6
  252. package/src/adloader.js +2 -1
  253. package/test/spec/modules/a1MediaRtdProvider_spec.js +105 -0
  254. package/test/spec/modules/adfBidAdapter_spec.js +47 -0
  255. package/test/spec/modules/adkernelAdnBidAdapter_spec.js +1 -2
  256. package/test/spec/modules/adkernelBidAdapter_spec.js +7 -2
  257. package/test/spec/modules/adnuntiusBidAdapter_spec.js +116 -64
  258. package/test/spec/modules/adyoulikeBidAdapter_spec.js +13 -24
  259. package/test/spec/modules/beachfrontBidAdapter_spec.js +35 -2
  260. package/test/spec/modules/consentManagementGpp_spec.js +16 -0
  261. package/test/spec/modules/consumableBidAdapter_spec.js +15 -0
  262. package/test/spec/modules/freewheel-sspBidAdapter_spec.js +5 -5
  263. package/test/spec/modules/geolocationRtdProvider_spec.js +119 -0
  264. package/test/spec/modules/greenbidsRtdProvider_spec.js +1 -1
  265. package/test/spec/modules/id5IdSystem_spec.js +18 -0
  266. package/test/spec/modules/imdsBidAdapter_spec.js +98 -17
  267. package/test/spec/modules/invibesBidAdapter_spec.js +123 -32
  268. package/test/spec/modules/ixBidAdapter_spec.js +23 -5
  269. package/test/spec/modules/medianetBidAdapter_spec.js +117 -0
  270. package/test/spec/modules/outbrainBidAdapter_spec.js +3 -5
  271. package/test/spec/modules/ozoneBidAdapter_spec.js +27 -1
  272. package/test/spec/modules/prebidServerBidAdapter_spec.js +2 -20
  273. package/test/spec/modules/priceFloors_spec.js +14 -0
  274. package/test/spec/modules/pubmaticBidAdapter_spec.js +6 -373
  275. package/test/spec/modules/rubiconBidAdapter_spec.js +220 -9
  276. package/test/spec/modules/smaatoBidAdapter_spec.js +4 -6
  277. package/test/spec/modules/ssmasBidAdapter_spec.js +244 -0
  278. package/test/spec/modules/sspBCBidAdapter_spec.js +18 -19
  279. package/test/spec/modules/tripleliftBidAdapter_spec.js +40 -0
  280. package/test/spec/modules/userId_spec.js +116 -7
  281. package/test/spec/modules/vrtcalBidAdapter_spec.js +12 -4
  282. package/test/spec/modules/xeBidAdapter_spec.js +366 -368
  283. package/test/spec/modules/yahoosspBidAdapter_spec.js +5 -18
  284. package/test/spec/unit/core/bidderFactory_spec.js +61 -14
  285. package/integrationExamples/gpt/pbjs_video_adUnit.html +0 -109
@@ -41,414 +41,412 @@ defaultRequestVideo.mediaTypes = {
41
41
  skipppable: true
42
42
  }
43
43
  };
44
+ describe('xeBidAdapter', () => {
45
+ describe('isBidRequestValid', function () {
46
+ it('should return false when request params is missing', function () {
47
+ const invalidRequest = deepClone(defaultRequest);
48
+ delete invalidRequest.params;
49
+ expect(spec.isBidRequestValid(invalidRequest)).to.equal(false);
50
+ });
44
51
 
45
- describe('isBidRequestValid', function () {
46
- it('should return false when request params is missing', function () {
47
- const invalidRequest = deepClone(defaultRequest);
48
- delete invalidRequest.params;
49
- expect(spec.isBidRequestValid(invalidRequest)).to.equal(false);
50
- });
51
-
52
- it('should return false when required env param is missing', function () {
53
- const invalidRequest = deepClone(defaultRequest);
54
- delete invalidRequest.params.env;
55
- expect(spec.isBidRequestValid(invalidRequest)).to.equal(false);
56
- });
52
+ it('should return false when required env param is missing', function () {
53
+ const invalidRequest = deepClone(defaultRequest);
54
+ delete invalidRequest.params.env;
55
+ expect(spec.isBidRequestValid(invalidRequest)).to.equal(false);
56
+ });
57
57
 
58
- it('should return false when required placement param is missing', function () {
59
- const invalidRequest = deepClone(defaultRequest);
60
- delete invalidRequest.params.placement;
61
- expect(spec.isBidRequestValid(invalidRequest)).to.equal(false);
62
- });
58
+ it('should return false when required placement param is missing', function () {
59
+ const invalidRequest = deepClone(defaultRequest);
60
+ delete invalidRequest.params.placement;
61
+ expect(spec.isBidRequestValid(invalidRequest)).to.equal(false);
62
+ });
63
63
 
64
- it('should return false when video.playerSize is missing', function () {
65
- const invalidRequest = deepClone(defaultRequestVideo);
66
- delete invalidRequest.mediaTypes.video.playerSize;
67
- expect(spec.isBidRequestValid(invalidRequest)).to.equal(false);
68
- });
64
+ it('should return false when video.playerSize is missing', function () {
65
+ const invalidRequest = deepClone(defaultRequestVideo);
66
+ delete invalidRequest.mediaTypes.video.playerSize;
67
+ expect(spec.isBidRequestValid(invalidRequest)).to.equal(false);
68
+ });
69
69
 
70
- it('should return true when required params found', function () {
71
- expect(spec.isBidRequestValid(defaultRequest)).to.equal(true);
70
+ it('should return true when required params found', function () {
71
+ expect(spec.isBidRequestValid(defaultRequest)).to.equal(true);
72
+ });
72
73
  });
73
- });
74
74
 
75
- describe('buildRequests', function () {
76
- beforeEach(function () {
77
- config.resetConfig();
78
- });
75
+ describe('buildRequests', function () {
76
+ beforeEach(function () {
77
+ config.resetConfig();
78
+ });
79
79
 
80
- it('should send request with correct structure', function () {
81
- const request = spec.buildRequests([defaultRequest], {});
82
- expect(request.method).to.equal('POST');
83
- expect(request.url).to.equal(ENDPOINT);
84
- expect(request.options).to.have.property('contentType').and.to.equal('application/json');
85
- expect(request).to.have.property('data');
86
- });
80
+ it('should send request with correct structure', function () {
81
+ const request = spec.buildRequests([defaultRequest], {});
82
+ expect(request.method).to.equal('POST');
83
+ expect(request.url).to.equal(ENDPOINT);
84
+ expect(request.options).to.have.property('contentType').and.to.equal('application/json');
85
+ expect(request).to.have.property('data');
86
+ });
87
87
 
88
- it('should build basic request structure', function () {
89
- const request = JSON.parse(spec.buildRequests([defaultRequest], {}).data)[0];
90
- expect(request).to.have.property('bidId').and.to.equal(defaultRequest.bidId);
91
- expect(request).to.have.property('auctionId').and.to.equal(defaultRequest.auctionId);
92
- expect(request).to.have.property('transactionId').and.to.equal(defaultRequest.ortb2Imp.ext.tid);
93
- expect(request).to.have.property('tz').and.to.equal(new Date().getTimezoneOffset());
94
- expect(request).to.have.property('bc').and.to.equal(1);
95
- expect(request).to.have.property('floor').and.to.equal(null);
96
- expect(request).to.have.property('banner').and.to.deep.equal({ sizes: [[300, 250], [300, 200]] });
97
- expect(request).to.have.property('gdprApplies').and.to.equal(0);
98
- expect(request).to.have.property('consentString').and.to.equal('');
99
- expect(request).to.have.property('userEids').and.to.deep.equal([]);
100
- expect(request).to.have.property('usPrivacy').and.to.equal('');
101
- expect(request).to.have.property('coppa').and.to.equal(0);
102
- expect(request).to.have.property('sizes').and.to.deep.equal(['300x250', '300x200']);
103
- expect(request).to.have.property('ext').and.to.deep.equal({});
104
- expect(request).to.have.property('env').and.to.deep.equal({
105
- env: 'xe',
106
- placement: 'test-banner'
107
- });
108
- expect(request).to.have.property('device').and.to.deep.equal({
109
- ua: navigator.userAgent,
110
- lang: navigator.language
88
+ it('should build basic request structure', function () {
89
+ const request = JSON.parse(spec.buildRequests([defaultRequest], {}).data)[0];
90
+ expect(request).to.have.property('bidId').and.to.equal(defaultRequest.bidId);
91
+ expect(request).to.have.property('auctionId').and.to.equal(defaultRequest.auctionId);
92
+ expect(request).to.have.property('transactionId').and.to.equal(defaultRequest.ortb2Imp.ext.tid);
93
+ expect(request).to.have.property('tz').and.to.equal(new Date().getTimezoneOffset());
94
+ expect(request).to.have.property('bc').and.to.equal(1);
95
+ expect(request).to.have.property('floor').and.to.equal(null);
96
+ expect(request).to.have.property('banner').and.to.deep.equal({ sizes: [[300, 250], [300, 200]] });
97
+ expect(request).to.have.property('gdprApplies').and.to.equal(0);
98
+ expect(request).to.have.property('consentString').and.to.equal('');
99
+ expect(request).to.have.property('userEids').and.to.deep.equal([]);
100
+ expect(request).to.have.property('usPrivacy').and.to.equal('');
101
+ expect(request).to.have.property('coppa').and.to.equal(0);
102
+ expect(request).to.have.property('sizes').and.to.deep.equal(['300x250', '300x200']);
103
+ expect(request).to.have.property('ext').and.to.deep.equal({});
104
+ expect(request).to.have.property('env').and.to.deep.equal({
105
+ env: 'xe',
106
+ placement: 'test-banner'
107
+ });
108
+ expect(request).to.have.property('device').and.to.deep.equal({
109
+ ua: navigator.userAgent,
110
+ lang: navigator.language
111
+ });
111
112
  });
112
- });
113
113
 
114
- it('should build request with schain', function () {
115
- const schainRequest = deepClone(defaultRequest);
116
- schainRequest.schain = {
117
- validation: 'strict',
118
- config: {
119
- ver: '1.0'
120
- }
121
- };
122
- const request = JSON.parse(spec.buildRequests([schainRequest], {}).data)[0];
123
- expect(request).to.have.property('schain').and.to.deep.equal({
124
- validation: 'strict',
125
- config: {
126
- ver: '1.0'
127
- }
114
+ it('should build request with schain', function () {
115
+ const schainRequest = deepClone(defaultRequest);
116
+ schainRequest.schain = {
117
+ validation: 'strict',
118
+ config: {
119
+ ver: '1.0'
120
+ }
121
+ };
122
+ const request = JSON.parse(spec.buildRequests([schainRequest], {}).data)[0];
123
+ expect(request).to.have.property('schain').and.to.deep.equal({
124
+ validation: 'strict',
125
+ config: {
126
+ ver: '1.0'
127
+ }
128
+ });
128
129
  });
129
- });
130
130
 
131
- it('should build request with location', function () {
132
- const bidderRequest = {
133
- refererInfo: {
134
- page: 'page',
135
- location: 'location',
136
- domain: 'domain',
137
- ref: 'ref',
138
- isAmp: false
139
- }
140
- };
141
- const request = JSON.parse(spec.buildRequests([defaultRequest], bidderRequest).data)[0];
142
- expect(request).to.have.property('location');
143
- const location = request.location;
144
- expect(location).to.have.property('page').and.to.equal('page');
145
- expect(location).to.have.property('location').and.to.equal('location');
146
- expect(location).to.have.property('domain').and.to.equal('domain');
147
- expect(location).to.have.property('ref').and.to.equal('ref');
148
- expect(location).to.have.property('isAmp').and.to.equal(false);
149
- });
131
+ it('should build request with location', function () {
132
+ const bidderRequest = {
133
+ refererInfo: {
134
+ page: 'page',
135
+ location: 'location',
136
+ domain: 'domain',
137
+ ref: 'ref',
138
+ isAmp: false
139
+ }
140
+ };
141
+ const request = JSON.parse(spec.buildRequests([defaultRequest], bidderRequest).data)[0];
142
+ expect(request).to.have.property('location');
143
+ const location = request.location;
144
+ expect(location).to.have.property('page').and.to.equal('page');
145
+ expect(location).to.have.property('location').and.to.equal('location');
146
+ expect(location).to.have.property('domain').and.to.equal('domain');
147
+ expect(location).to.have.property('ref').and.to.equal('ref');
148
+ expect(location).to.have.property('isAmp').and.to.equal(false);
149
+ });
150
150
 
151
- it('should build request with ortb2 info', function () {
152
- const ortb2Request = deepClone(defaultRequest);
153
- ortb2Request.ortb2 = {
154
- site: {
155
- name: 'name'
156
- }
157
- };
158
- const request = JSON.parse(spec.buildRequests([ortb2Request], {}).data)[0];
159
- expect(request).to.have.property('ortb2').and.to.deep.equal({
160
- site: {
161
- name: 'name'
162
- }
151
+ it('should build request with ortb2 info', function () {
152
+ const ortb2Request = deepClone(defaultRequest);
153
+ ortb2Request.ortb2 = {
154
+ site: {
155
+ name: 'name'
156
+ }
157
+ };
158
+ const request = JSON.parse(spec.buildRequests([ortb2Request], {}).data)[0];
159
+ expect(request).to.have.property('ortb2').and.to.deep.equal({
160
+ site: {
161
+ name: 'name'
162
+ }
163
+ });
163
164
  });
164
- });
165
165
 
166
- it('should build request with ortb2Imp info', function () {
167
- const ortb2ImpRequest = deepClone(defaultRequest);
168
- ortb2ImpRequest.ortb2Imp = {
169
- ext: {
170
- data: {
171
- pbadslot: 'home1',
172
- adUnitSpecificAttribute: '1'
166
+ it('should build request with ortb2Imp info', function () {
167
+ const ortb2ImpRequest = deepClone(defaultRequest);
168
+ ortb2ImpRequest.ortb2Imp = {
169
+ ext: {
170
+ data: {
171
+ pbadslot: 'home1',
172
+ adUnitSpecificAttribute: '1'
173
+ }
173
174
  }
174
- }
175
- };
176
- const request = JSON.parse(spec.buildRequests([ortb2ImpRequest], {}).data)[0];
177
- expect(request).to.have.property('ortb2Imp').and.to.deep.equal({
178
- ext: {
179
- data: {
180
- pbadslot: 'home1',
181
- adUnitSpecificAttribute: '1'
175
+ };
176
+ const request = JSON.parse(spec.buildRequests([ortb2ImpRequest], {}).data)[0];
177
+ expect(request).to.have.property('ortb2Imp').and.to.deep.equal({
178
+ ext: {
179
+ data: {
180
+ pbadslot: 'home1',
181
+ adUnitSpecificAttribute: '1'
182
+ }
182
183
  }
183
- }
184
+ });
184
185
  });
185
- });
186
186
 
187
- it('should build request with valid bidfloor', function () {
188
- const bfRequest = deepClone(defaultRequest);
189
- bfRequest.getFloor = () => ({ floor: 5, currency: 'USD' });
190
- const request = JSON.parse(spec.buildRequests([bfRequest], {}).data)[0];
191
- expect(request).to.have.property('floor').and.to.equal(5);
192
- });
187
+ it('should build request with valid bidfloor', function () {
188
+ const bfRequest = deepClone(defaultRequest);
189
+ bfRequest.getFloor = () => ({ floor: 5, currency: 'USD' });
190
+ const request = JSON.parse(spec.buildRequests([bfRequest], {}).data)[0];
191
+ expect(request).to.have.property('floor').and.to.equal(5);
192
+ });
193
193
 
194
- it('should build request with gdpr consent data if applies', function () {
195
- const bidderRequest = {
196
- gdprConsent: {
197
- gdprApplies: true,
198
- consentString: 'qwerty'
199
- }
200
- };
201
- const request = JSON.parse(spec.buildRequests([defaultRequest], bidderRequest).data)[0];
202
- expect(request).to.have.property('gdprApplies').and.equals(1);
203
- expect(request).to.have.property('consentString').and.equals('qwerty');
204
- });
194
+ it('should build request with gdpr consent data if applies', function () {
195
+ const bidderRequest = {
196
+ gdprConsent: {
197
+ gdprApplies: true,
198
+ consentString: 'qwerty'
199
+ }
200
+ };
201
+ const request = JSON.parse(spec.buildRequests([defaultRequest], bidderRequest).data)[0];
202
+ expect(request).to.have.property('gdprApplies').and.equals(1);
203
+ expect(request).to.have.property('consentString').and.equals('qwerty');
204
+ });
205
205
 
206
- it('should build request with usp consent data if applies', function () {
207
- const bidderRequest = {
208
- uspConsent: '1YA-'
209
- };
210
- const request = JSON.parse(spec.buildRequests([defaultRequest], bidderRequest).data)[0];
211
- expect(request).to.have.property('usPrivacy').and.equals('1YA-');
212
- });
206
+ it('should build request with usp consent data if applies', function () {
207
+ const bidderRequest = {
208
+ uspConsent: '1YA-'
209
+ };
210
+ const request = JSON.parse(spec.buildRequests([defaultRequest], bidderRequest).data)[0];
211
+ expect(request).to.have.property('usPrivacy').and.equals('1YA-');
212
+ });
213
213
 
214
- it('should build request with coppa 1', function () {
215
- config.setConfig({
216
- coppa: true
214
+ it('should build request with coppa 1', function () {
215
+ config.setConfig({
216
+ coppa: true
217
+ });
218
+ const request = JSON.parse(spec.buildRequests([defaultRequest], {}).data)[0];
219
+ expect(request).to.have.property('coppa').and.equals(1);
217
220
  });
218
- const request = JSON.parse(spec.buildRequests([defaultRequest], {}).data)[0];
219
- expect(request).to.have.property('coppa').and.equals(1);
220
- });
221
221
 
222
- it('should build request with extended ids', function () {
223
- const idRequest = deepClone(defaultRequest);
224
- idRequest.userIdAsEids = createEidsArray({
225
- tdid: 'TTD_ID_FROM_USER_ID_MODULE',
226
- pubcid: 'pubCommonId_FROM_USER_ID_MODULE'
227
- });
228
- const request = JSON.parse(spec.buildRequests([idRequest], {}).data)[0];
229
- expect(request).to.have.property('userEids').and.deep.equal([
230
- { source: 'adserver.org', uids: [ { id: 'TTD_ID_FROM_USER_ID_MODULE', atype: 1, ext: { rtiPartner: 'TDID' } } ] },
231
- { source: 'pubcid.org', uids: [ { id: 'pubCommonId_FROM_USER_ID_MODULE', atype: 1 } ] }
232
- ]);
233
- });
222
+ it('should build request with extended ids', function () {
223
+ const idRequest = deepClone(defaultRequest);
224
+ idRequest.userIdAsEids = [
225
+ { source: 'adserver.org', uids: [ { id: 'TTD_ID_FROM_USER_ID_MODULE', atype: 1, ext: { rtiPartner: 'TDID' } } ] },
226
+ { source: 'pubcid.org', uids: [ { id: 'pubCommonId_FROM_USER_ID_MODULE', atype: 1 } ] }
227
+ ];
228
+ const request = JSON.parse(spec.buildRequests([idRequest], {}).data)[0];
229
+ expect(request).to.have.property('userEids').and.deep.equal(idRequest.userIdAsEids);
230
+ });
234
231
 
235
- it('should build request with video', function () {
236
- const request = JSON.parse(spec.buildRequests([defaultRequestVideo], {}).data)[0];
237
- expect(request).to.have.property('video').and.to.deep.equal({
238
- playerSize: [640, 480],
239
- context: 'instream',
240
- skipppable: true
232
+ it('should build request with video', function () {
233
+ const request = JSON.parse(spec.buildRequests([defaultRequestVideo], {}).data)[0];
234
+ expect(request).to.have.property('video').and.to.deep.equal({
235
+ playerSize: [640, 480],
236
+ context: 'instream',
237
+ skipppable: true
238
+ });
239
+ expect(request).to.have.property('sizes').and.to.deep.equal(['640x480']);
241
240
  });
242
- expect(request).to.have.property('sizes').and.to.deep.equal(['640x480']);
243
- });
244
- });
245
-
246
- describe('interpretResponse', function () {
247
- it('should return empty bids', function () {
248
- const serverResponse = {
249
- body: {
250
- data: null
251
- }
252
- };
253
-
254
- const invalidResponse = spec.interpretResponse(serverResponse, {});
255
- expect(invalidResponse).to.be.an('array').that.is.empty;
256
241
  });
257
242
 
258
- it('should interpret valid response', function () {
259
- const serverResponse = {
260
- body: {
261
- data: [{
262
- requestId: 'qwerty',
263
- cpm: 1,
264
- currency: 'USD',
265
- width: 300,
266
- height: 250,
267
- ttl: 600,
268
- meta: {
269
- advertiserDomains: ['xe.works']
270
- },
271
- ext: {
272
- pixels: [
273
- [ 'iframe', 'surl1' ],
274
- [ 'image', 'surl2' ],
275
- ]
276
- }
277
- }]
278
- }
279
- };
280
-
281
- const validResponse = spec.interpretResponse(serverResponse, { bidderRequest: defaultRequest });
282
- const bid = validResponse[0];
283
- expect(validResponse).to.be.an('array').that.is.not.empty;
284
- expect(bid.requestId).to.equal('qwerty');
285
- expect(bid.cpm).to.equal(1);
286
- expect(bid.currency).to.equal('USD');
287
- expect(bid.width).to.equal(300);
288
- expect(bid.height).to.equal(250);
289
- expect(bid.ttl).to.equal(600);
290
- expect(bid.meta).to.deep.equal({ advertiserDomains: ['xe.works'] });
291
- });
243
+ describe('interpretResponse', function () {
244
+ it('should return empty bids', function () {
245
+ const serverResponse = {
246
+ body: {
247
+ data: null
248
+ }
249
+ };
292
250
 
293
- it('should interpret valid banner response', function () {
294
- const serverResponse = {
295
- body: {
296
- data: [{
297
- requestId: 'qwerty',
298
- cpm: 1,
299
- currency: 'USD',
300
- width: 300,
301
- height: 250,
302
- ttl: 600,
303
- mediaType: 'banner',
304
- creativeId: 'xe-demo-banner',
305
- ad: 'ad',
306
- meta: {}
307
- }]
308
- }
309
- };
310
-
311
- const validResponseBanner = spec.interpretResponse(serverResponse, { bidderRequest: defaultRequest });
312
- const bid = validResponseBanner[0];
313
- expect(validResponseBanner).to.be.an('array').that.is.not.empty;
314
- expect(bid.mediaType).to.equal('banner');
315
- expect(bid.creativeId).to.equal('xe-demo-banner');
316
- expect(bid.ad).to.equal('ad');
317
- });
251
+ const invalidResponse = spec.interpretResponse(serverResponse, {});
252
+ expect(invalidResponse).to.be.an('array').that.is.empty;
253
+ });
318
254
 
319
- it('should interpret valid video response', function () {
320
- const serverResponse = {
321
- body: {
322
- data: [{
323
- requestId: 'qwerty',
324
- cpm: 1,
325
- currency: 'USD',
326
- width: 600,
327
- height: 480,
328
- ttl: 600,
329
- mediaType: 'video',
330
- creativeId: 'xe-demo-video',
331
- ad: 'vast-xml',
332
- meta: {}
333
- }]
334
- }
335
- };
336
-
337
- const validResponseBanner = spec.interpretResponse(serverResponse, { bidderRequest: defaultRequestVideo });
338
- const bid = validResponseBanner[0];
339
- expect(validResponseBanner).to.be.an('array').that.is.not.empty;
340
- expect(bid.mediaType).to.equal('video');
341
- expect(bid.creativeId).to.equal('xe-demo-video');
342
- expect(bid.ad).to.equal('vast-xml');
343
- });
344
- });
255
+ it('should interpret valid response', function () {
256
+ const serverResponse = {
257
+ body: {
258
+ data: [{
259
+ requestId: 'qwerty',
260
+ cpm: 1,
261
+ currency: 'USD',
262
+ width: 300,
263
+ height: 250,
264
+ ttl: 600,
265
+ meta: {
266
+ advertiserDomains: ['xe.works']
267
+ },
268
+ ext: {
269
+ pixels: [
270
+ [ 'iframe', 'surl1' ],
271
+ [ 'image', 'surl2' ],
272
+ ]
273
+ }
274
+ }]
275
+ }
276
+ };
277
+
278
+ const validResponse = spec.interpretResponse(serverResponse, { bidderRequest: defaultRequest });
279
+ const bid = validResponse[0];
280
+ expect(validResponse).to.be.an('array').that.is.not.empty;
281
+ expect(bid.requestId).to.equal('qwerty');
282
+ expect(bid.cpm).to.equal(1);
283
+ expect(bid.currency).to.equal('USD');
284
+ expect(bid.width).to.equal(300);
285
+ expect(bid.height).to.equal(250);
286
+ expect(bid.ttl).to.equal(600);
287
+ expect(bid.meta).to.deep.equal({ advertiserDomains: ['xe.works'] });
288
+ });
345
289
 
346
- describe('getUserSyncs', function () {
347
- it('shoukd handle no params', function () {
348
- const opts = spec.getUserSyncs({}, []);
349
- expect(opts).to.be.an('array').that.is.empty;
350
- });
290
+ it('should interpret valid banner response', function () {
291
+ const serverResponse = {
292
+ body: {
293
+ data: [{
294
+ requestId: 'qwerty',
295
+ cpm: 1,
296
+ currency: 'USD',
297
+ width: 300,
298
+ height: 250,
299
+ ttl: 600,
300
+ mediaType: 'banner',
301
+ creativeId: 'xe-demo-banner',
302
+ ad: 'ad',
303
+ meta: {}
304
+ }]
305
+ }
306
+ };
307
+
308
+ const validResponseBanner = spec.interpretResponse(serverResponse, { bidderRequest: defaultRequest });
309
+ const bid = validResponseBanner[0];
310
+ expect(validResponseBanner).to.be.an('array').that.is.not.empty;
311
+ expect(bid.mediaType).to.equal('banner');
312
+ expect(bid.creativeId).to.equal('xe-demo-banner');
313
+ expect(bid.ad).to.equal('ad');
314
+ });
351
315
 
352
- it('should return empty if sync is not allowed', function () {
353
- const opts = spec.getUserSyncs({iframeEnabled: false, pixelEnabled: false});
354
- expect(opts).to.be.an('array').that.is.empty;
316
+ it('should interpret valid video response', function () {
317
+ const serverResponse = {
318
+ body: {
319
+ data: [{
320
+ requestId: 'qwerty',
321
+ cpm: 1,
322
+ currency: 'USD',
323
+ width: 600,
324
+ height: 480,
325
+ ttl: 600,
326
+ mediaType: 'video',
327
+ creativeId: 'xe-demo-video',
328
+ ad: 'vast-xml',
329
+ meta: {}
330
+ }]
331
+ }
332
+ };
333
+
334
+ const validResponseBanner = spec.interpretResponse(serverResponse, { bidderRequest: defaultRequestVideo });
335
+ const bid = validResponseBanner[0];
336
+ expect(validResponseBanner).to.be.an('array').that.is.not.empty;
337
+ expect(bid.mediaType).to.equal('video');
338
+ expect(bid.creativeId).to.equal('xe-demo-video');
339
+ expect(bid.ad).to.equal('vast-xml');
340
+ });
355
341
  });
356
342
 
357
- it('should allow iframe sync', function () {
358
- const opts = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: false}, [{
359
- body: {
360
- data: [{
361
- requestId: 'qwerty',
362
- ext: {
363
- pixels: [
364
- [ 'iframe', 'surl1?a=b' ],
365
- [ 'image', 'surl2?a=b' ],
366
- ]
367
- }
368
- }]
369
- }
370
- }]);
371
- expect(opts.length).to.equal(1);
372
- expect(opts[0].type).to.equal('iframe');
373
- expect(opts[0].url).to.equal('surl1?a=b&us_privacy=&gdpr=0&gdpr_consent=');
374
- });
343
+ describe('getUserSyncs', function () {
344
+ it('shoukd handle no params', function () {
345
+ const opts = spec.getUserSyncs({}, []);
346
+ expect(opts).to.be.an('array').that.is.empty;
347
+ });
375
348
 
376
- it('should allow pixel sync', function () {
377
- const opts = spec.getUserSyncs({iframeEnabled: false, pixelEnabled: true}, [{
378
- body: {
379
- data: [{
380
- requestId: 'qwerty',
381
- ext: {
382
- pixels: [
383
- [ 'iframe', 'surl1?a=b' ],
384
- [ 'image', 'surl2?a=b' ],
385
- ]
386
- }
387
- }]
388
- }
389
- }]);
390
- expect(opts.length).to.equal(1);
391
- expect(opts[0].type).to.equal('image');
392
- expect(opts[0].url).to.equal('surl2?a=b&us_privacy=&gdpr=0&gdpr_consent=');
393
- });
349
+ it('should return empty if sync is not allowed', function () {
350
+ const opts = spec.getUserSyncs({iframeEnabled: false, pixelEnabled: false});
351
+ expect(opts).to.be.an('array').that.is.empty;
352
+ });
394
353
 
395
- it('should allow pixel sync and parse consent params', function () {
396
- const opts = spec.getUserSyncs({iframeEnabled: false, pixelEnabled: true}, [{
397
- body: {
398
- data: [{
399
- requestId: 'qwerty',
400
- ext: {
401
- pixels: [
402
- [ 'iframe', 'surl1?a=b' ],
403
- [ 'image', 'surl2?a=b' ],
404
- ]
405
- }
406
- }]
407
- }
408
- }], {
409
- gdprApplies: 1,
410
- consentString: '1YA-'
411
- });
412
- expect(opts.length).to.equal(1);
413
- expect(opts[0].type).to.equal('image');
414
- expect(opts[0].url).to.equal('surl2?a=b&us_privacy=&gdpr=1&gdpr_consent=1YA-');
415
- });
416
- });
354
+ it('should allow iframe sync', function () {
355
+ const opts = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: false}, [{
356
+ body: {
357
+ data: [{
358
+ requestId: 'qwerty',
359
+ ext: {
360
+ pixels: [
361
+ [ 'iframe', 'surl1?a=b' ],
362
+ [ 'image', 'surl2?a=b' ],
363
+ ]
364
+ }
365
+ }]
366
+ }
367
+ }]);
368
+ expect(opts.length).to.equal(1);
369
+ expect(opts[0].type).to.equal('iframe');
370
+ expect(opts[0].url).to.equal('surl1?a=b&us_privacy=&gdpr=0&gdpr_consent=');
371
+ });
417
372
 
418
- describe('getBidFloor', function () {
419
- it('should return null when getFloor is not a function', () => {
420
- const bid = { getFloor: 2 };
421
- const result = getBidFloor(bid);
422
- expect(result).to.be.null;
423
- });
373
+ it('should allow pixel sync', function () {
374
+ const opts = spec.getUserSyncs({iframeEnabled: false, pixelEnabled: true}, [{
375
+ body: {
376
+ data: [{
377
+ requestId: 'qwerty',
378
+ ext: {
379
+ pixels: [
380
+ [ 'iframe', 'surl1?a=b' ],
381
+ [ 'image', 'surl2?a=b' ],
382
+ ]
383
+ }
384
+ }]
385
+ }
386
+ }]);
387
+ expect(opts.length).to.equal(1);
388
+ expect(opts[0].type).to.equal('image');
389
+ expect(opts[0].url).to.equal('surl2?a=b&us_privacy=&gdpr=0&gdpr_consent=');
390
+ });
424
391
 
425
- it('should return null when getFloor doesnt return an object', () => {
426
- const bid = { getFloor: () => 2 };
427
- const result = getBidFloor(bid);
428
- expect(result).to.be.null;
392
+ it('should allow pixel sync and parse consent params', function () {
393
+ const opts = spec.getUserSyncs({iframeEnabled: false, pixelEnabled: true}, [{
394
+ body: {
395
+ data: [{
396
+ requestId: 'qwerty',
397
+ ext: {
398
+ pixels: [
399
+ [ 'iframe', 'surl1?a=b' ],
400
+ [ 'image', 'surl2?a=b' ],
401
+ ]
402
+ }
403
+ }]
404
+ }
405
+ }], {
406
+ gdprApplies: 1,
407
+ consentString: '1YA-'
408
+ });
409
+ expect(opts.length).to.equal(1);
410
+ expect(opts[0].type).to.equal('image');
411
+ expect(opts[0].url).to.equal('surl2?a=b&us_privacy=&gdpr=1&gdpr_consent=1YA-');
412
+ });
429
413
  });
430
414
 
431
- it('should return null when floor is not a number', () => {
432
- const bid = {
433
- getFloor: () => ({ floor: 'string', currency: 'USD' })
434
- };
435
- const result = getBidFloor(bid);
436
- expect(result).to.be.null;
437
- });
415
+ describe('getBidFloor', function () {
416
+ it('should return null when getFloor is not a function', () => {
417
+ const bid = { getFloor: 2 };
418
+ const result = getBidFloor(bid);
419
+ expect(result).to.be.null;
420
+ });
438
421
 
439
- it('should return null when currency is not USD', () => {
440
- const bid = {
441
- getFloor: () => ({ floor: 5, currency: 'EUR' })
442
- };
443
- const result = getBidFloor(bid);
444
- expect(result).to.be.null;
445
- });
422
+ it('should return null when getFloor doesnt return an object', () => {
423
+ const bid = { getFloor: () => 2 };
424
+ const result = getBidFloor(bid);
425
+ expect(result).to.be.null;
426
+ });
446
427
 
447
- it('should return floor value when everything is correct', () => {
448
- const bid = {
449
- getFloor: () => ({ floor: 5, currency: 'USD' })
450
- };
451
- const result = getBidFloor(bid);
452
- expect(result).to.equal(5);
428
+ it('should return null when floor is not a number', () => {
429
+ const bid = {
430
+ getFloor: () => ({ floor: 'string', currency: 'USD' })
431
+ };
432
+ const result = getBidFloor(bid);
433
+ expect(result).to.be.null;
434
+ });
435
+
436
+ it('should return null when currency is not USD', () => {
437
+ const bid = {
438
+ getFloor: () => ({ floor: 5, currency: 'EUR' })
439
+ };
440
+ const result = getBidFloor(bid);
441
+ expect(result).to.be.null;
442
+ });
443
+
444
+ it('should return floor value when everything is correct', () => {
445
+ const bid = {
446
+ getFloor: () => ({ floor: 5, currency: 'USD' })
447
+ };
448
+ const result = getBidFloor(bid);
449
+ expect(result).to.equal(5);
450
+ });
453
451
  });
454
- });
452
+ })