prebid.js 7.22.0 → 7.24.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 (314) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/aaxBlockmeterRtdProvider.js +1 -0
  3. package/dist/adagioBidAdapter.js +1 -1
  4. package/dist/adbookpspBidAdapter.js +1 -1
  5. package/dist/adgenerationBidAdapter.js +1 -1
  6. package/dist/admaticBidAdapter.js +1 -0
  7. package/dist/adrelevantisBidAdapter.js +1 -1
  8. package/dist/adtrgtmeBidAdapter.js +1 -1
  9. package/dist/adxcgBidAdapter.js +1 -1
  10. package/dist/adyoulikeBidAdapter.js +1 -1
  11. package/dist/ajaBidAdapter.js +1 -1
  12. package/dist/amxBidAdapter.js +1 -1
  13. package/dist/amxIdSystem.js +1 -1
  14. package/dist/analyticsAdapter.js +1 -1
  15. package/dist/appierAnalyticsAdapter.js +1 -1
  16. package/dist/appnexusBidAdapter.js +1 -1
  17. package/dist/asoBidAdapter.js +1 -1
  18. package/dist/audiencerunBidAdapter.js +1 -1
  19. package/dist/axonixBidAdapter.js +1 -1
  20. package/dist/bidViewability.js +1 -1
  21. package/dist/bidViewabilityIO.js +1 -1
  22. package/dist/bidglassBidAdapter.js +1 -1
  23. package/dist/big-richmediaBidAdapter.js +1 -1
  24. package/dist/bluebillywigBidAdapter.js +1 -1
  25. package/dist/bridgewellBidAdapter.js +1 -1
  26. package/dist/brightMountainMediaBidAdapter.js +1 -1
  27. package/dist/browsiRtdProvider.js +1 -1
  28. package/dist/carodaBidAdapter.js +1 -1
  29. package/dist/chtnwBidAdapter.js +1 -0
  30. package/dist/cleanioRtdProvider.js +1 -1
  31. package/dist/concertBidAdapter.js +1 -1
  32. package/dist/connectIdSystem.js +1 -1
  33. package/dist/connectadBidAdapter.js +1 -1
  34. package/dist/consentManagement.js +1 -1
  35. package/dist/consentManagementUsp.js +1 -1
  36. package/dist/consumableBidAdapter.js +1 -1
  37. package/dist/conversantBidAdapter.js +1 -1
  38. package/dist/craftBidAdapter.js +1 -1
  39. package/dist/criteoBidAdapter.js +1 -1
  40. package/dist/currency.js +1 -1
  41. package/dist/dependencies.json +19 -0
  42. package/dist/dfpAdServerVideo.js +1 -1
  43. package/dist/dgkeywordRtdProvider.js +1 -1
  44. package/dist/dspxBidAdapter.js +1 -1
  45. package/dist/eplanningBidAdapter.js +1 -1
  46. package/dist/finativeBidAdapter.js +1 -1
  47. package/dist/gdprEnforcement.js +1 -1
  48. package/dist/glimpseBidAdapter.js +1 -1
  49. package/dist/gmosspBidAdapter.js +1 -1
  50. package/dist/goldbachBidAdapter.js +1 -1
  51. package/dist/googleAnalyticsAdapter.js +1 -1
  52. package/dist/gridBidAdapter.js +1 -1
  53. package/dist/gridNMBidAdapter.js +1 -1
  54. package/dist/growthCodeIdSystem.js +1 -1
  55. package/dist/gumgumBidAdapter.js +1 -1
  56. package/dist/h12mediaBidAdapter.js +1 -1
  57. package/dist/id5AnalyticsAdapter.js +1 -1
  58. package/dist/id5IdSystem.js +1 -1
  59. package/dist/impactifyBidAdapter.js +1 -1
  60. package/dist/improvedigitalBidAdapter.js +1 -1
  61. package/dist/inmarBidAdapter.js +1 -1
  62. package/dist/insticatorBidAdapter.js +1 -1
  63. package/dist/instreamTracking.js +1 -1
  64. package/dist/ixBidAdapter.js +1 -1
  65. package/dist/jixieBidAdapter.js +1 -1
  66. package/dist/justpremiumBidAdapter.js +1 -1
  67. package/dist/jwplayerVideoProvider.js +1 -0
  68. package/dist/kargoBidAdapter.js +1 -1
  69. package/dist/konduitAnalyticsAdapter.js +1 -1
  70. package/dist/kueezBidAdapter.js +1 -1
  71. package/dist/kueezRtbBidAdapter.js +1 -0
  72. package/dist/lassoBidAdapter.js +1 -1
  73. package/dist/lifestreetBidAdapter.js +1 -1
  74. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  75. package/dist/logicadBidAdapter.js +1 -1
  76. package/dist/loglyliftBidAdapter.js +1 -1
  77. package/dist/magniteAnalyticsAdapter.js +1 -1
  78. package/dist/malltvAnalyticsAdapter.js +1 -1
  79. package/dist/marsmediaBidAdapter.js +1 -1
  80. package/dist/mediafuseBidAdapter.js +1 -1
  81. package/dist/mediakeysBidAdapter.js +1 -1
  82. package/dist/mediasquareBidAdapter.js +1 -1
  83. package/dist/mgidBidAdapter.js +1 -1
  84. package/dist/mgidRtdProvider.js +1 -0
  85. package/dist/minutemediaBidAdapter.js +1 -1
  86. package/dist/multibid.js +1 -1
  87. package/dist/not-for-prod/prebid.js +153 -141
  88. package/dist/oguryBidAdapter.js +1 -1
  89. package/dist/onetagBidAdapter.js +1 -1
  90. package/dist/ooloAnalyticsAdapter.js +1 -1
  91. package/dist/openxOrtbBidAdapter.js +1 -1
  92. package/dist/ortbConverter.js +1 -0
  93. package/dist/outbrainBidAdapter.js +1 -1
  94. package/dist/oxxionRtdProvider.js +1 -0
  95. package/dist/parrableIdSystem.js +1 -1
  96. package/dist/pbsExtensions.js +1 -0
  97. package/dist/permutiveRtdProvider.js +1 -1
  98. package/dist/pixfutureBidAdapter.js +1 -1
  99. package/dist/prebid-core.js +1 -1
  100. package/dist/prebidServerBidAdapter.js +1 -1
  101. package/dist/priceFloors.js +1 -1
  102. package/dist/pubCommonId.js +1 -1
  103. package/dist/publinkIdSystem.js +1 -1
  104. package/dist/pubmaticBidAdapter.js +1 -1
  105. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  106. package/dist/pxyzBidAdapter.js +1 -1
  107. package/dist/quantcastBidAdapter.js +1 -1
  108. package/dist/readpeakBidAdapter.js +1 -1
  109. package/dist/relaidoBidAdapter.js +1 -1
  110. package/dist/rhythmoneBidAdapter.js +1 -1
  111. package/dist/riseBidAdapter.js +1 -1
  112. package/dist/rtdModule.js +1 -1
  113. package/dist/rubiconAnalyticsAdapter.js +1 -1
  114. package/dist/rubiconBidAdapter.js +1 -1
  115. package/dist/schain.js +1 -1
  116. package/dist/seedingAllianceBidAdapter.js +1 -1
  117. package/dist/seedtagBidAdapter.js +1 -1
  118. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  119. package/dist/sharethroughBidAdapter.js +1 -1
  120. package/dist/shinezBidAdapter.js +1 -1
  121. package/dist/smaatoBidAdapter.js +1 -1
  122. package/dist/smartadserverBidAdapter.js +1 -1
  123. package/dist/smartxBidAdapter.js +1 -1
  124. package/dist/smilewantedBidAdapter.js +1 -1
  125. package/dist/sonobiBidAdapter.js +1 -1
  126. package/dist/sovrnAnalyticsAdapter.js +1 -1
  127. package/dist/sovrnBidAdapter.js +1 -1
  128. package/dist/spotxBidAdapter.js +1 -1
  129. package/dist/sspBCBidAdapter.js +1 -1
  130. package/dist/sublimeBidAdapter.js +1 -1
  131. package/dist/synacormediaBidAdapter.js +1 -1
  132. package/dist/targetVideoBidAdapter.js +1 -1
  133. package/dist/teadsBidAdapter.js +1 -1
  134. package/dist/teadsIdSystem.js +1 -1
  135. package/dist/trionBidAdapter.js +1 -1
  136. package/dist/tripleliftBidAdapter.js +1 -1
  137. package/dist/ttdBidAdapter.js +1 -1
  138. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  139. package/dist/underdogmediaBidAdapter.js +1 -1
  140. package/dist/undertoneBidAdapter.js +1 -1
  141. package/dist/userId.js +1 -1
  142. package/dist/vidazooBidAdapter.js +1 -1
  143. package/dist/video.js +1 -0
  144. package/dist/videoModule.js +1 -0
  145. package/dist/videobyteBidAdapter.js +1 -1
  146. package/dist/videojsVideoProvider.js +1 -0
  147. package/dist/visxBidAdapter.js +1 -1
  148. package/dist/vuukleBidAdapter.js +1 -1
  149. package/dist/widespaceBidAdapter.js +1 -1
  150. package/dist/winrBidAdapter.js +1 -1
  151. package/dist/yahoosspBidAdapter.js +1 -1
  152. package/dist/yieldmoBidAdapter.js +1 -1
  153. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  154. package/integrationExamples/gpt/mgidRtdProvider_example.html +143 -0
  155. package/integrationExamples/videoModule/jwplayer/bidMarkedAsUsed.html +98 -0
  156. package/integrationExamples/videoModule/jwplayer/bidRequestScheduling.html +89 -0
  157. package/integrationExamples/videoModule/jwplayer/eventListeners.html +244 -0
  158. package/integrationExamples/videoModule/jwplayer/gamAdServerMediation.html +122 -0
  159. package/integrationExamples/videoModule/jwplayer/mediaMetadata.html +80 -0
  160. package/integrationExamples/videoModule/jwplayer/playlist.html +122 -0
  161. package/integrationExamples/videoModule/videojs/bidMarkedAsUsed.html +126 -0
  162. package/integrationExamples/videoModule/videojs/bidRequestScheduling.html +132 -0
  163. package/integrationExamples/videoModule/videojs/eventListeners.html +238 -0
  164. package/integrationExamples/videoModule/videojs/gamAdServerMediation.html +138 -0
  165. package/integrationExamples/videoModule/videojs/mediaMetadata.html +103 -0
  166. package/integrationExamples/videoModule/videojs/playlist.html +151 -0
  167. package/libraries/ortbConverter/README.md +378 -0
  168. package/libraries/ortbConverter/converter.js +135 -0
  169. package/libraries/ortbConverter/lib/composer.js +43 -0
  170. package/libraries/ortbConverter/lib/mergeProcessors.js +9 -0
  171. package/libraries/ortbConverter/lib/sizes.js +14 -0
  172. package/libraries/ortbConverter/processors/banner.js +40 -0
  173. package/libraries/ortbConverter/processors/default.js +167 -0
  174. package/libraries/ortbConverter/processors/mediaType.js +21 -0
  175. package/libraries/ortbConverter/processors/native.js +37 -0
  176. package/libraries/ortbConverter/processors/video.js +66 -0
  177. package/libraries/pbsExtensions/pbsExtensions.js +12 -0
  178. package/libraries/pbsExtensions/processors/aliases.js +17 -0
  179. package/libraries/pbsExtensions/processors/mediaType.js +23 -0
  180. package/libraries/pbsExtensions/processors/params.js +22 -0
  181. package/libraries/pbsExtensions/processors/pbs.js +99 -0
  182. package/libraries/pbsExtensions/processors/requestExtPrebid.js +30 -0
  183. package/libraries/pbsExtensions/processors/video.js +23 -0
  184. package/libraries/video/constants/enums.js +5 -0
  185. package/libraries/video/constants/events.js +97 -0
  186. package/libraries/video/constants/ortb.js +169 -0
  187. package/libraries/video/constants/vendorCodes.js +6 -0
  188. package/libraries/video/shared/eventHandler.js +18 -0
  189. package/libraries/video/shared/parentModule.js +82 -0
  190. package/libraries/video/shared/state.js +47 -0
  191. package/libraries/video/shared/vastXmlBuilder.js +77 -0
  192. package/libraries/video/shared/vastXmlEditor.js +115 -0
  193. package/modules/.submodules.json +7 -1
  194. package/modules/aaxBlockmeterRtdProvider.js +59 -0
  195. package/modules/aaxBlockmeterRtdProvider.md +48 -0
  196. package/modules/admaticBidAdapter.js +147 -0
  197. package/modules/admaticBidAdapter.md +48 -0
  198. package/modules/amxBidAdapter.js +1 -0
  199. package/modules/appnexusBidAdapter.js +38 -1
  200. package/modules/chtnwBidAdapter.js +110 -0
  201. package/modules/chtnwBidAdapter.md +31 -0
  202. package/modules/concertBidAdapter.js +44 -2
  203. package/modules/connectIdSystem.js +36 -23
  204. package/modules/connectIdSystem.md +3 -2
  205. package/modules/consentManagement.js +22 -1
  206. package/modules/consentManagementUsp.js +29 -7
  207. package/modules/criteoBidAdapter.js +25 -5
  208. package/modules/currency.js +9 -0
  209. package/modules/dgkeywordRtdProvider.js +3 -3
  210. package/modules/gridNMBidAdapter.js +10 -14
  211. package/modules/growthCodeIdSystem.js +9 -5
  212. package/modules/gumgumBidAdapter.js +4 -0
  213. package/modules/improvedigitalBidAdapter.js +191 -470
  214. package/modules/ixBidAdapter.js +54 -71
  215. package/modules/jwplayerVideoProvider.js +929 -0
  216. package/modules/jwplayerVideoProvider.md +25 -0
  217. package/modules/kargoBidAdapter.js +1 -1
  218. package/modules/kueezRtbBidAdapter.js +278 -0
  219. package/modules/kueezRtbBidAdapter.md +35 -0
  220. package/modules/magniteAnalyticsAdapter.js +6 -1
  221. package/modules/mgidRtdProvider.js +190 -0
  222. package/modules/mgidRtdProvider.md +51 -0
  223. package/modules/multibid/index.js +12 -0
  224. package/modules/openxOrtbBidAdapter.js +120 -275
  225. package/modules/oxxionRtdProvider.js +119 -0
  226. package/modules/oxxionRtdProvider.md +48 -0
  227. package/modules/permutiveRtdProvider.js +2 -1
  228. package/modules/permutiveRtdProvider.md +36 -1
  229. package/modules/prebidServerBidAdapter/index.js +19 -716
  230. package/modules/prebidServerBidAdapter/ortbConverter.js +274 -0
  231. package/modules/priceFloors.js +73 -1
  232. package/modules/pubmaticBidAdapter.js +21 -29
  233. package/modules/rtdModule/index.js +22 -1
  234. package/modules/schain.js +24 -1
  235. package/modules/spotxBidAdapter.js +16 -15
  236. package/modules/synacormediaBidAdapter.js +1 -1
  237. package/modules/teadsIdSystem.js +5 -0
  238. package/modules/tripleliftBidAdapter.js +1 -1
  239. package/modules/userId/eids.js +3 -10
  240. package/modules/userId/index.js +64 -6
  241. package/modules/videoModule/addingSubmodule.md +521 -0
  242. package/modules/videoModule/coreVideo.js +234 -0
  243. package/modules/videoModule/gamAdServerSubmodule.js +27 -0
  244. package/modules/videoModule/index.js +244 -0
  245. package/modules/videoModule/videoImpressionVerifier.js +206 -0
  246. package/modules/videojsVideoProvider.js +854 -0
  247. package/modules/videojsVideoProvider.md +17 -0
  248. package/package.json +12 -8
  249. package/src/adRendering.js +1 -1
  250. package/src/adapterManager.js +56 -7
  251. package/src/adloader.js +3 -1
  252. package/src/auction.js +6 -1
  253. package/src/events.js +5 -1
  254. package/src/pbjsORTB.js +35 -0
  255. package/src/prebid.js +137 -112
  256. package/src/targeting.js +10 -2
  257. package/src/utils/currency.js +16 -0
  258. package/src/utils.js +21 -0
  259. package/test/spec/auctionmanager_spec.js +15 -0
  260. package/test/spec/modules/aaxBlockmeter_spec.js +58 -0
  261. package/test/spec/modules/admaticBidAdapter_spec.js +46 -0
  262. package/test/spec/modules/chtnwBidAdapter_spec.js +105 -0
  263. package/test/spec/modules/concertBidAdapter_spec.js +56 -0
  264. package/test/spec/modules/connectIdSystem_spec.js +175 -5
  265. package/test/spec/modules/consentManagementUsp_spec.js +64 -18
  266. package/test/spec/modules/criteoBidAdapter_spec.js +28 -0
  267. package/test/spec/modules/dgkeywordRtdProvider_spec.js +3 -3
  268. package/test/spec/modules/eids_spec.js +10 -7
  269. package/test/spec/modules/ftrackIdSystem_spec.js +34 -22
  270. package/test/spec/modules/gumgumBidAdapter_spec.js +15 -0
  271. package/test/spec/modules/improvedigitalBidAdapter_spec.js +231 -211
  272. package/test/spec/modules/ixBidAdapter_spec.js +412 -350
  273. package/test/spec/modules/kueezRtbBidAdapter_spec.js +396 -0
  274. package/test/spec/modules/magniteAnalyticsAdapter_spec.js +26 -0
  275. package/test/spec/modules/mgidRtdProvider_spec.js +366 -0
  276. package/test/spec/modules/openxOrtbBidAdapter_spec.js +77 -49
  277. package/test/spec/modules/oxxionRtdProvider_spec.js +142 -0
  278. package/test/spec/modules/permutiveRtdProvider_spec.js +64 -5
  279. package/test/spec/modules/prebidServerBidAdapter_spec.js +139 -137
  280. package/test/spec/modules/realTimeDataModule_spec.js +65 -0
  281. package/test/spec/modules/tripleliftBidAdapter_spec.js +14 -0
  282. package/test/spec/modules/userId_spec.js +67 -1
  283. package/test/spec/modules/videoModule/coreVideo_spec.js +98 -0
  284. package/test/spec/modules/videoModule/pbVideo_spec.js +362 -0
  285. package/test/spec/modules/videoModule/shared/parentModule_spec.js +73 -0
  286. package/test/spec/modules/videoModule/shared/state_spec.js +26 -0
  287. package/test/spec/modules/videoModule/shared/vastXmlBuilder_spec.js +103 -0
  288. package/test/spec/modules/videoModule/shared/vastXmlEditor_spec.js +209 -0
  289. package/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +846 -0
  290. package/test/spec/modules/videoModule/submodules/videojsVideoProvider_spec.js +391 -0
  291. package/test/spec/modules/videoModule/videoImpressionVerifier_spec.js +112 -0
  292. package/test/spec/ortbConverter/banner_spec.js +203 -0
  293. package/test/spec/ortbConverter/composer_spec.js +69 -0
  294. package/test/spec/ortbConverter/converter_spec.js +283 -0
  295. package/test/spec/ortbConverter/currency_spec.js +40 -0
  296. package/test/spec/ortbConverter/default_processors_spec.js +61 -0
  297. package/test/spec/ortbConverter/gdpr_spec.js +38 -0
  298. package/test/spec/ortbConverter/mediaTypes_spec.js +67 -0
  299. package/test/spec/ortbConverter/mergeProcessors_spec.js +59 -0
  300. package/test/spec/ortbConverter/multibid_spec.js +35 -0
  301. package/test/spec/ortbConverter/native_spec.js +95 -0
  302. package/test/spec/ortbConverter/pbjsORTB_spec.js +67 -0
  303. package/test/spec/ortbConverter/pbsExtensions/aliases_spec.js +57 -0
  304. package/test/spec/ortbConverter/pbsExtensions/params_spec.js +96 -0
  305. package/test/spec/ortbConverter/pbsExtensions/video_spec.js +52 -0
  306. package/test/spec/ortbConverter/priceFloors_spec.js +143 -0
  307. package/test/spec/ortbConverter/schain_spec.js +33 -0
  308. package/test/spec/ortbConverter/userId_spec.js +21 -0
  309. package/test/spec/ortbConverter/usp_spec.js +15 -0
  310. package/test/spec/ortbConverter/video_spec.js +189 -0
  311. package/test/spec/unit/core/adapterManager_spec.js +102 -0
  312. package/test/spec/unit/core/targeting_spec.js +34 -0
  313. package/test/spec/unit/pbjs_api_spec.js +124 -45
  314. package/test/spec/utils_spec.js +45 -1
@@ -1,14 +1,28 @@
1
1
  import { expect } from 'chai';
2
- import { spec } from 'modules/improvedigitalBidAdapter.js';
2
+ import {CONVERTER, spec} from 'modules/improvedigitalBidAdapter.js';
3
3
  import { config } from 'src/config.js';
4
4
  import { deepClone } from 'src/utils.js';
5
5
  import {BANNER, NATIVE, VIDEO} from '../../../src/mediaTypes';
6
6
  import { deepSetValue } from '../../../src/utils';
7
+ // load modules that register ORTB processors
8
+ import 'src/prebid.js';
9
+ import 'modules/currency.js';
10
+ import 'modules/userId/index.js';
11
+ import 'modules/multibid/index.js';
12
+ import 'modules/priceFloors.js';
13
+ import 'modules/consentManagement.js';
14
+ import 'modules/consentManagementUsp.js';
15
+ import 'modules/schain.js';
16
+ import {decorateAdUnitsWithNativeParams, toLegacyResponse} from '../../../src/native.js';
17
+ import {createEidsArray} from '../../../modules/userId/eids.js';
7
18
 
8
19
  describe('Improve Digital Adapter Tests', function () {
9
20
  const METHOD = 'POST';
10
- const AD_SERVER_URL = 'https://ad.360yield.com/pb';
11
- const BASIC_ADS_URL = 'https://ad.360yield-basic.com/pb';
21
+ const AD_SERVER_BASE_URL = 'https://ad.360yield.com';
22
+ const BASIC_ADS_BASE_URL = 'https://ad.360yield-basic.com';
23
+ const PB_ENDPOINT = 'pb';
24
+ const AD_SERVER_URL = `${AD_SERVER_BASE_URL}/${PB_ENDPOINT}`;
25
+ const BASIC_ADS_URL = `${BASIC_ADS_BASE_URL}/${PB_ENDPOINT}`;
12
26
  const EXTEND_URL = 'https://pbs.360yield.com/openrtb2/auction';
13
27
  const IFRAME_SYNC_URL = 'https://hb.360yield.com/prebid-universal-creative/load-cookie.html';
14
28
  const INSTREAM_TYPE = 1;
@@ -93,6 +107,7 @@ describe('Improve Digital Adapter Tests', function () {
93
107
  };
94
108
 
95
109
  const simpleSmartTagBidRequest = {
110
+ mediaTypes: {},
96
111
  bidder: 'improvedigital',
97
112
  bidId: '1a2b3c',
98
113
  placementCode: 'placement1',
@@ -103,27 +118,27 @@ describe('Improve Digital Adapter Tests', function () {
103
118
  };
104
119
 
105
120
  const bidderRequest = {
106
- bids: [simpleBidRequest]
121
+ bids: [simpleBidRequest],
107
122
  };
108
123
 
109
124
  const extendBidderRequest = {
110
- bids: [extendBidRequest]
125
+ bids: [extendBidRequest],
111
126
  };
112
127
 
113
128
  const instreamBidderRequest = {
114
- bids: [instreamBidRequest]
129
+ bids: [instreamBidRequest],
115
130
  };
116
131
 
117
132
  const outstreamBidderRequest = {
118
- bids: [outstreamBidRequest]
133
+ bids: [outstreamBidRequest],
119
134
  };
120
135
 
121
136
  const multiFormatBidderRequest = {
122
- bids: [multiFormatBidRequest]
137
+ bids: [multiFormatBidRequest],
123
138
  };
124
139
 
125
140
  const nativeBidderRequest = {
126
- bids: [nativeBidRequest]
141
+ bids: [nativeBidRequest],
127
142
  };
128
143
 
129
144
  const gdprConsent = {
@@ -147,6 +162,12 @@ describe('Improve Digital Adapter Tests', function () {
147
162
  },
148
163
  };
149
164
 
165
+ function updateNativeParams(bidRequests) {
166
+ bidRequests = deepClone(bidRequests);
167
+ decorateAdUnitsWithNativeParams(bidRequests);
168
+ return bidRequests;
169
+ }
170
+
150
171
  describe('isBidRequestValid', function () {
151
172
  it('should return false when no bid', function () {
152
173
  expect(spec.isBidRequestValid()).to.equal(false);
@@ -203,20 +224,18 @@ describe('Improve Digital Adapter Tests', function () {
203
224
  expect(request).to.be.an('object');
204
225
  expect(request.method).to.equal(METHOD);
205
226
  expect(request.url).to.equal(AD_SERVER_URL);
206
- expect(request.bidderRequest).to.deep.equal(bidderRequest);
207
227
 
208
228
  const payload = JSON.parse(request.data);
209
229
  expect(payload).to.be.an('object');
210
230
  expect(payload.id).to.be.a('string');
211
231
  expect(payload.tmax).not.to.exist;
212
- expect(payload.cur).to.be.an('array');
213
232
  expect(payload.regs).to.not.exist;
214
233
  expect(payload.schain).to.not.exist;
215
- expect(payload.source).to.deep.equal({ ext: {}, tid: 'f183e871-fbed-45f0-a427-c8a63c4c01eb' });
234
+ sinon.assert.match(payload.source, {tid: 'f183e871-fbed-45f0-a427-c8a63c4c01eb'})
216
235
  expect(payload.device).to.be.an('object');
217
236
  expect(payload.user).to.not.exist;
218
- expect(payload.imp).to.deep.equal([
219
- {
237
+ sinon.assert.match(payload.imp, [
238
+ sinon.match({
220
239
  id: '33e9500b21129f',
221
240
  secure: 0,
222
241
  ext: {
@@ -230,28 +249,23 @@ describe('Improve Digital Adapter Tests', function () {
230
249
  {w: 160, h: 600},
231
250
  ]
232
251
  }
233
- }
252
+ })
234
253
  ]);
235
254
  });
236
255
 
237
256
  it('should make a well-formed request object for multi-format ad unit', function () {
238
257
  getConfigStub = sinon.stub(config, 'getConfig');
239
258
  getConfigStub.withArgs('improvedigital.usePrebidSizes').returns(true);
240
- const request = spec.buildRequests([multiFormatBidRequest], multiFormatBidderRequest)[0];
259
+ const request = spec.buildRequests(updateNativeParams([multiFormatBidRequest]), multiFormatBidderRequest)[0];
241
260
  expect(request).to.be.an('object');
242
261
  expect(request.method).to.equal(METHOD);
243
262
  expect(request.url).to.equal(AD_SERVER_URL);
244
- expect(request.bidderRequest).to.deep.equal(multiFormatBidderRequest);
245
263
 
246
264
  const payload = JSON.parse(request.data);
247
265
  expect(payload).to.be.an('object');
248
- expect(payload.imp).to.deep.equal([
249
- {
266
+ sinon.assert.match(payload.imp, [
267
+ sinon.match({
250
268
  id: '33e9500b21129f',
251
- native: {
252
- request: '{"eventtrackers":[{"event":1,"methods":[1,2]}],"assets":[{"id":3,"required":1,"data":{"type":2}}]}',
253
- ver: '1.2'
254
- },
255
269
  secure: 0,
256
270
  ext: {
257
271
  bidder: {
@@ -270,53 +284,54 @@ describe('Improve Digital Adapter Tests', function () {
270
284
  {w: 160, h: 600},
271
285
  ]
272
286
  }
273
- }
287
+ })
274
288
  ]);
289
+ if (FEATURES.NATIVE) {
290
+ sinon.assert.match(payload.imp[0], {
291
+ native: {
292
+ ver: '1.2'
293
+ },
294
+ })
295
+ const nativeReq = JSON.parse(payload.imp[0].native.request);
296
+ sinon.assert.match(nativeReq, {
297
+ eventtrackers: [
298
+ {event: 1, methods: [1, 2]},
299
+ ],
300
+ 'assets': [
301
+ sinon.match({'required': 1, 'data': {'type': 2}})
302
+ ]
303
+ });
304
+ }
275
305
  });
276
306
 
277
- it('should make a well-formed native request', function () {
278
- const payload = JSON.parse(spec.buildRequests([nativeBidRequest], {})[0].data);
279
- expect(payload.imp[0].native).to.deep.equal({
280
- ver: '1.2',
281
- request: '{"eventtrackers":[{"event":1,"methods":[1,2]}],"assets":[{"id":0,"required":1,"title":{"len":140}},{"id":3,"required":1,"data":{"type":2}}]}'
307
+ if (FEATURES.NATIVE) {
308
+ it('should make a well-formed native request', function () {
309
+ const payload = JSON.parse(spec.buildRequests(updateNativeParams([nativeBidRequest]), {})[0].data);
310
+ const nativeReq = JSON.parse(payload.imp[0].native.request);
311
+ sinon.assert.match(nativeReq, {
312
+ eventtrackers: [
313
+ {event: 1, methods: [1, 2]},
314
+ ],
315
+ assets: [
316
+ sinon.match({required: 1, title: {len: 140}}),
317
+ sinon.match({required: 1, data: {type: 2}})
318
+ ]
319
+ })
282
320
  });
283
- });
284
-
285
- it('should not make native request when nativeParams is undefined', function () {
286
- const request = deepClone(nativeBidRequest);
287
- delete request.nativeParams;
288
- const payload = JSON.parse(spec.buildRequests([request], {})[0].data);
289
- expect(payload.imp[0].native).to.not.exist;
290
- });
291
321
 
292
- it('should not make native request when no assets', function () {
293
- const request = deepClone(nativeBidRequest);
294
- request.nativeParams = {};
295
- const payload = JSON.parse(spec.buildRequests([request], {})[0].data);
296
- expect(payload.imp[0].native).to.not.exist;
297
- });
298
-
299
- it('should make a well-formed native request', function () {
300
- const payload = JSON.parse(spec.buildRequests([nativeBidRequest], {})[0].data);
301
- expect(payload.imp[0].native).to.deep.equal({
302
- ver: '1.2',
303
- request: '{"eventtrackers":[{"event":1,"methods":[1,2]}],"assets":[{"id":0,"required":1,"title":{"len":140}},{"id":3,"required":1,"data":{"type":2}}]}'
322
+ it('should not make native request when nativeOrtbRequest is undefined', function () {
323
+ const requests = updateNativeParams([nativeBidRequest]);
324
+ delete requests[0].nativeOrtbRequest;
325
+ const payload = JSON.parse(spec.buildRequests(requests, {})[0].data);
326
+ expect(payload.imp[0].native).to.not.exist;
304
327
  });
305
- });
306
328
 
307
- it('should not make native request when nativeParams is undefined', function () {
308
- const request = deepClone(nativeBidRequest);
309
- delete request.nativeParams;
310
- const payload = JSON.parse(spec.buildRequests([request], {})[0].data);
311
- expect(payload.imp[0].native).to.not.exist;
312
- });
313
-
314
- it('should not make native request when no assets', function () {
315
- const request = deepClone(nativeBidRequest);
316
- request.nativeParams = {};
317
- const payload = JSON.parse(spec.buildRequests([request], {})[0].data);
318
- expect(payload.imp[0].native).to.not.exist;
319
- });
329
+ it('should not make native request when no assets', function () {
330
+ const requests = updateNativeParams([{...nativeBidRequest, nativeParams: {}}])
331
+ const payload = JSON.parse(spec.buildRequests(requests, {})[0].data);
332
+ expect(payload.imp[0].native).to.not.exist;
333
+ });
334
+ }
320
335
 
321
336
  it('should set placementKey and publisherId for smart tags', function () {
322
337
  const payload = JSON.parse(spec.buildRequests([simpleSmartTagBidRequest], bidderRequest)[0].data);
@@ -337,10 +352,14 @@ describe('Improve Digital Adapter Tests', function () {
337
352
  });
338
353
 
339
354
  it('should add currency', function () {
340
- const bidRequest = Object.assign({}, simpleBidRequest);
341
- getConfigStub = sinon.stub(config, 'getConfig').returns('JPY');
342
- const payload = JSON.parse(spec.buildRequests([bidRequest], bidderRequest)[0].data);
343
- expect(payload.cur).to.deep.equal(['JPY']);
355
+ config.setConfig({currency: {adServerCurrency: 'JPY'}});
356
+ try {
357
+ const bidRequest = Object.assign({}, simpleBidRequest);
358
+ const payload = JSON.parse(spec.buildRequests([bidRequest], bidderRequest)[0].data);
359
+ expect(payload.cur).to.deep.equal(['JPY']);
360
+ } finally {
361
+ config.resetConfig();
362
+ }
344
363
  });
345
364
 
346
365
  it('should add bid floor', function () {
@@ -374,6 +393,7 @@ describe('Improve Digital Adapter Tests', function () {
374
393
  const payload = JSON.parse(spec.buildRequests([bidRequest], bidderRequestGdpr)[0].data);
375
394
  expect(payload.regs.ext.gdpr).to.exist.and.to.equal(1);
376
395
  expect(payload.user.ext.consent).to.equal('CONSENT');
396
+ expect(payload.user.ext.ConsentedProvidersSettings).to.not.exist;
377
397
  expect(payload.user.ext.consented_providers_settings.consented_providers).to.exist.and.to.deep.equal([1, 35, 41, 101]);
378
398
  });
379
399
 
@@ -385,6 +405,15 @@ describe('Improve Digital Adapter Tests', function () {
385
405
  expect(payload.user.ext.consented_providers_settings).to.not.exist;
386
406
  });
387
407
 
408
+ it('should add ConsentedProvidersSettings when extend mode enabled', function () {
409
+ const bidRequest = deepClone(extendBidRequest);
410
+ const payload = JSON.parse(spec.buildRequests([bidRequest], bidderRequestGdpr)[0].data);
411
+ expect(payload.regs.ext.gdpr).to.exist.and.to.equal(1);
412
+ expect(payload.user.ext.consent).to.equal('CONSENT');
413
+ expect(payload.user.ext.ConsentedProvidersSettings.consented_providers).to.exist.and.to.equal('1~1.35.41.101');
414
+ expect(payload.user.ext.consented_providers_settings).to.not.exist;
415
+ });
416
+
388
417
  it('should add CCPA consent string', function () {
389
418
  const bidRequest = Object.assign({}, simpleBidRequest);
390
419
  const request = spec.buildRequests([bidRequest], {...bidderRequest, ...{ uspConsent: '1YYY' }});
@@ -486,40 +515,6 @@ describe('Improve Digital Adapter Tests', function () {
486
515
  expect(payload.imp[0].video.w).equal(640);
487
516
  });
488
517
 
489
- it('should set skip params only if skip=1', function() {
490
- const bidRequest = deepClone(instreamBidRequest);
491
- // 1
492
- const videoTest = {
493
- skip: 1,
494
- skipmin: 5,
495
- skipafter: 30
496
- }
497
- bidRequest.params.video = videoTest;
498
- let request = spec.buildRequests([bidRequest], {})[0];
499
- let payload = JSON.parse(request.data);
500
- expect(payload.imp[0].video.skip).to.equal(1);
501
- expect(payload.imp[0].video.skipmin).to.equal(5);
502
- expect(payload.imp[0].video.skipafter).to.equal(30);
503
-
504
- // 0 - leave out skipmin and skipafter
505
- videoTest.skip = 0;
506
- bidRequest.params.video = videoTest;
507
- request = spec.buildRequests([bidRequest], {})[0];
508
- payload = JSON.parse(request.data);
509
- expect(payload.imp[0].video.skip).to.equal(0);
510
- expect(payload.imp[0].video.skipmin).to.not.exist;
511
- expect(payload.imp[0].video.skipafter).to.not.exist;
512
-
513
- // other
514
- videoTest.skip = 'blah';
515
- bidRequest.params.video = videoTest;
516
- request = spec.buildRequests([bidRequest], {})[0];
517
- payload = JSON.parse(request.data);
518
- expect(payload.imp[0].video.skip).to.not.exist;
519
- expect(payload.imp[0].video.skipmin).to.not.exist;
520
- expect(payload.imp[0].video.skipafter).to.not.exist;
521
- });
522
-
523
518
  it('should ignore invalid/unexpected video params', function() {
524
519
  const bidRequest = deepClone(instreamBidRequest);
525
520
  // 1
@@ -583,7 +578,7 @@ describe('Improve Digital Adapter Tests', function () {
583
578
  }]
584
579
  }]}};
585
580
  const bidRequest = Object.assign({}, simpleBidRequest);
586
- bidRequest.userId = userId;
581
+ bidRequest.userIdAsEids = createEidsArray(userId);
587
582
  const request = spec.buildRequests([bidRequest], bidderRequestReferrer)[0];
588
583
  const payload = JSON.parse(request.data);
589
584
  expect(payload.user).to.deep.equal(expectedUserObject);
@@ -596,8 +591,6 @@ describe('Improve Digital Adapter Tests', function () {
596
591
  ], bidderRequest);
597
592
  expect(requests).to.be.an('array');
598
593
  expect(requests.length).to.equal(2);
599
- expect(requests[0].bidderRequest).to.deep.equal(bidderRequest);
600
- expect(requests[1].bidderRequest).to.deep.equal(bidderRequest);
601
594
  });
602
595
 
603
596
  it('should return one request in a single request mode', function () {
@@ -632,7 +625,7 @@ describe('Improve Digital Adapter Tests', function () {
632
625
  getConfigStub.withArgs('improvedigital.usePrebidSizes').returns(true);
633
626
  const request = spec.buildRequests([simpleBidRequest], bidderRequest)[0];
634
627
  const payload = JSON.parse(request.data);
635
- expect(payload.imp[0].banner).to.deep.equal({
628
+ sinon.assert.match(payload.imp[0].banner, {
636
629
  format: [
637
630
  { w: 300, h: 250 },
638
631
  { w: 160, h: 600 }
@@ -651,7 +644,7 @@ describe('Improve Digital Adapter Tests', function () {
651
644
  bidRequest.params.size = size;
652
645
  const request = spec.buildRequests([bidRequest], bidderRequest)[0];
653
646
  const payload = JSON.parse(request.data);
654
- expect(payload.imp[0].banner).to.deep.equal({
647
+ sinon.assert.match(payload.imp[0].banner, {
655
648
  format: [
656
649
  { w: 300, h: 250 },
657
650
  { w: 160, h: 600 }
@@ -659,44 +652,6 @@ describe('Improve Digital Adapter Tests', function () {
659
652
  });
660
653
  });
661
654
 
662
- it('should set GPID and Instl Signal', function () {
663
- const bidRequest = Object.assign({
664
- ortb2Imp: {
665
- instl: true,
666
- ext: {
667
- gpid: '/123/ID-FORMAT',
668
- data: {
669
- pbadslot: '/123/ID-FORMAT-PBADSLOT',
670
- adserver: {
671
- adslot: '/123/ID-FORMAT-ADSERVER-PB-ADSLOT',
672
- }
673
- }
674
- },
675
- }
676
- }, simpleBidRequest);
677
- let request = spec.buildRequests([bidRequest], bidderRequest)[0];
678
- let payload = JSON.parse(request.data);
679
- expect(payload.imp[0].ext.gpid).to.equal('/123/ID-FORMAT');
680
- expect(payload.imp[0].instl).to.equal(1);
681
-
682
- delete bidRequest.ortb2Imp.ext.gpid;
683
- request = spec.buildRequests([bidRequest], bidderRequest)[0];
684
- payload = JSON.parse(request.data);
685
- expect(payload.imp[0].ext.gpid).to.equal('/123/ID-FORMAT-PBADSLOT');
686
-
687
- delete bidRequest.ortb2Imp.ext.data.pbadslot;
688
- request = spec.buildRequests([bidRequest], bidderRequest)[0];
689
- payload = JSON.parse(request.data);
690
- expect(payload.imp[0].ext.gpid).to.equal('/123/ID-FORMAT-ADSERVER-PB-ADSLOT');
691
-
692
- delete bidRequest.ortb2Imp.ext.data.adserver;
693
- delete bidRequest.ortb2Imp.instl;
694
- request = spec.buildRequests([bidRequest], bidderRequest)[0];
695
- payload = JSON.parse(request.data);
696
- expect(payload.imp[0].ext.gpid).to.not.exist;
697
- expect(payload.imp[0].instl).to.not.exist;
698
- });
699
-
700
655
  it('should not set site when app is defined in FPD', function () {
701
656
  const ortb2 = {app: {content: 'XYZ'}};
702
657
  let request = spec.buildRequests([simpleBidRequest], {...bidderRequest, ortb2})[0];
@@ -747,6 +702,7 @@ describe('Improve Digital Adapter Tests', function () {
747
702
  it('should set site when app not available', function () {
748
703
  getConfigStub = sinon.stub(config, 'getConfig');
749
704
  getConfigStub.withArgs('app').returns(undefined);
705
+ getConfigStub.withArgs('site').returns({});
750
706
  let request = spec.buildRequests([simpleBidRequest], bidderRequest)[0];
751
707
  let payload = JSON.parse(request.data);
752
708
  expect(payload.site).does.exist;
@@ -810,6 +766,64 @@ describe('Improve Digital Adapter Tests', function () {
810
766
  expect(requests[0].url).to.equal(AD_SERVER_URL);
811
767
  expect(requests[1].url).to.equal(EXTEND_URL);
812
768
  });
769
+
770
+ it('should add publisherId to request URL when available in request params', function() {
771
+ function formatPublisherUrl(baseUrl, publisherId) {
772
+ return `${baseUrl}/${publisherId}/${PB_ENDPOINT}`;
773
+ }
774
+ const bidRequest = deepClone(simpleBidRequest);
775
+ bidRequest.params.publisherId = 1000;
776
+ let request = spec.buildRequests([bidRequest], bidderRequest)[0];
777
+ expect(request).to.be.an('object');
778
+ sinon.assert.match(request, {
779
+ method: METHOD,
780
+ url: formatPublisherUrl(AD_SERVER_BASE_URL, 1000),
781
+ bidderRequest
782
+ });
783
+
784
+ const bidRequest2 = deepClone(simpleBidRequest)
785
+ bidRequest2.params.publisherId = 1002;
786
+
787
+ const bidRequest3 = deepClone(extendBidRequest)
788
+ bidRequest3.params.publisherId = 1002;
789
+
790
+ const request1 = spec.buildRequests([bidRequest, bidRequest2], bidderRequest)[0];
791
+ expect(request1.url).to.equal(formatPublisherUrl(AD_SERVER_BASE_URL, 1000));
792
+ const request2 = spec.buildRequests([bidRequest, bidRequest2], bidderRequest)[1];
793
+ expect(request2.url).to.equal(formatPublisherUrl(AD_SERVER_BASE_URL, 1002));
794
+ const request3 = spec.buildRequests([bidRequest, bidRequest3], bidderRequest)[1];
795
+ expect(request3.url).to.equal(EXTEND_URL);
796
+
797
+ // Enable single request mode
798
+ getConfigStub = sinon.stub(config, 'getConfig');
799
+ getConfigStub.withArgs('improvedigital.singleRequest').returns(true);
800
+ try {
801
+ spec.buildRequests([bidRequest, bidRequest2], bidderRequest)[0];
802
+ } catch (e) {
803
+ expect(e.name).to.exist.equal('Error')
804
+ expect(e.message).to.exist.equal(`All Improve Digital placements in a single call must have the same publisherId. Please check your 'params.publisherId' or turn off the single request mode.`)
805
+ }
806
+
807
+ bidRequest2.params.publisherId = null;
808
+ request = spec.buildRequests([bidRequest, bidRequest2], bidderRequest)[0];
809
+ expect(request.url).to.equal(formatPublisherUrl(AD_SERVER_BASE_URL, 1000));
810
+
811
+ const consent = deepClone(gdprConsent);
812
+ deepSetValue(consent, 'vendorData.purpose.consents.1', false);
813
+ const bidderRequestWithConsent = deepClone(bidderRequest);
814
+ bidderRequestWithConsent.gdprConsent = consent;
815
+ request = spec.buildRequests([bidRequest], bidderRequestWithConsent)[0];
816
+ expect(request.url).to.equal(formatPublisherUrl(BASIC_ADS_BASE_URL, 1000));
817
+
818
+ deepSetValue(consent, 'vendorData.purpose.consents.1', true);
819
+ bidderRequestWithConsent.gdprConsent = consent;
820
+ request = spec.buildRequests([bidRequest], bidderRequestWithConsent)[0];
821
+ expect(request.url).to.equal(formatPublisherUrl(AD_SERVER_BASE_URL, 1000));
822
+
823
+ delete bidRequest.params.publisherId;
824
+ request = spec.buildRequests([bidRequest], bidderRequestWithConsent)[0];
825
+ expect(request.url).to.equal(AD_SERVER_URL);
826
+ });
813
827
  });
814
828
 
815
829
  const serverResponse = {
@@ -829,7 +843,6 @@ describe('Improve Digital Adapter Tests', function () {
829
843
  'agency_id': '0'
830
844
  }
831
845
  },
832
- 'exp': 120,
833
846
  'crid': '510265',
834
847
  'price': 1.9200543539802946,
835
848
  'id': '35adfe19-d6e9-46b9-9f7d-20da7026b965',
@@ -872,7 +885,6 @@ describe('Improve Digital Adapter Tests', function () {
872
885
  'agency_id': '0'
873
886
  }
874
887
  },
875
- 'exp': 120,
876
888
  'crid': '510265',
877
889
  'price': 1.9200543539802946,
878
890
  'id': '35adfe19-d6e9-46b9-9f7d-20da7026b965',
@@ -892,7 +904,6 @@ describe('Improve Digital Adapter Tests', function () {
892
904
  'agency_id': '0'
893
905
  }
894
906
  },
895
- 'exp': 120,
896
907
  'crid': '479163',
897
908
  'price': 1.9200543539802946,
898
909
  'id': '83c8d524-0955-4d0c-b558-4c9f3600e09b',
@@ -937,10 +948,9 @@ describe('Improve Digital Adapter Tests', function () {
937
948
  }
938
949
  },
939
950
  'crid': '544456',
940
- 'exp': 120,
941
951
  'id': '52098fad-20c1-476b-a4fa-41e275e5a4a5',
942
952
  'price': 1.8600000000000003,
943
- 'adm': '{"ver":"1.1","imptrackers":["https://secure.adnxs.com/imptr?id=52311&t=2","https://euw-ice.360yield.com/imp_pixel?ic=hcUBlCANx1FabHBf6FR2gC7UO4xEyXahdZAn0-B5qL-bb3A74BJ1smyWIyW7IWcC0SOjSXzVpevTHXxTqJ.sf.Qhahyy6tSo.0j1QWfXlH8sM4-8vKWjMjw-x.IrJJNlwkQ0s1CdwcwTefcLXm5l2E-W19VhACuV7f3mgrZMNjiSw.SjJAfyPC3SIyAMRjYfj53UmjriQ46T7lhmkqxK8wHmksYCdbZc3PZESk8NWl28sxdjNvnYYCFMcJbeav.LOLabyTXfwy-1cEPbQs.IKMRZIKaqccTDPV3wOtzbNv0jQzatd3Nnv-PGFQcjQ-GW3i27W04Fws4kodpFSn-B6VwZAjzLzoyd5gBncyRnAyCplEbgHU5sZ1IyKHWjgCl3ZtRIK5vqrRD5D-xqgSnOi7-phG.CqZWDZ4bMDSfQg2ZnbvUTyGKcEl0WR59dW5izTMV4Fjizcrvr5T-t.zMbGwz.hGnmLIyhTqh.IcwW.GiDLVExlDlix5S1LXIWVsSyrQ=="],"assets":[{"id":1,"data":{"value":"ImproveDigital","type":1}},{"id":3,"data":{"value":"Test content.","type":2}},{"id":0,"title":{"text":"Sample Prebid Test Title"}}],"link":{"url":"https://euw-ice.360yield.com/click/hcUBlHOV7YhVse8RyBa0ajjyPa9Vt17e4g-1m3cRj3E67vq-RYux.SiUeAmBfNBcoOqkUc6A15AWmi4yFu5K-BdkaYjildyyk7fNLyR6hWr411kv4vrFwm5jrIBceuHS6K8oN69f.uCo8zGTdR2TbSlldwcpahQPlufZU.6VaMsu4IC53uEiUT5vb7kAw6TTlxuGBNq6zaGryiWEV2.N3YYJDTyYPh8tv-ZFyeFZFm0Gnjv.xWbC.70JcRUVU9UelQaPsTpTWYTXBhJt84YJUw1-GNtaLNVLSjjZbVoA2fsMti5p6OBmF.7u39on2OPgvseIkSmge7Pqg63pRqdP75hp.DAEk6OkcN1jGnwP2DSbvpaSbin5lVqjfO0B-wnQgfQTCUtM5v4JmkNweLhUf9Q-x.nPKLW5SccEk9ZFXzY2-1wpT3PWm8Tix3NRscLPZub9wHzL..pl6ip8cQ9hp16UjwT4H6RMAxL0R7bl-h2pAicGAzYmuO7ntRESKUoIWA==//http%3A%2F%2Fquantum-advertising.com%2Ffr%2F"},"jstracker":"<script type=\\"application/javascript\\">var js_tracker = [\\"https://secure.adnxs.com/imptr?id=52312&t=1\\", \\"https://pixel.adsafeprotected.com/rjss/st/291611/36974035/skeleton.js?ias_adpath=[class~=ea_improve_pid_${TAG_ID}]\\"]</script>"}',
953
+ 'adm': "{\"ver\":\"1.1\",\"imptrackers\":[\"https://secure.adnxs.com/imptr?id=52311&t=2\",\"https://euw-ice.360yield.com/imp_pixel?ic=hcUBlCANx1FabHBf6FR2gC7UO4xEyXahdZAn0-B5qL-bb3A74BJ1smyWIyW7IWcC0SOjSXzVpevTHXxTqJ.sf.Qhahyy6tSo.0j1QWfXlH8sM4-8vKWjMjw-x.IrJJNlwkQ0s1CdwcwTefcLXm5l2E-W19VhACuV7f3mgrZMNjiSw.SjJAfyPC3SIyAMRjYfj53UmjriQ46T7lhmkqxK8wHmksYCdbZc3PZESk8NWl28sxdjNvnYYCFMcJbeav.LOLabyTXfwy-1cEPbQs.IKMRZIKaqccTDPV3wOtzbNv0jQzatd3Nnv-PGFQcjQ-GW3i27W04Fws4kodpFSn-B6VwZAjzLzoyd5gBncyRnAyCplEbgHU5sZ1IyKHWjgCl3ZtRIK5vqrRD5D-xqgSnOi7-phG.CqZWDZ4bMDSfQg2ZnbvUTyGKcEl0WR59dW5izTMV4Fjizcrvr5T-t.zMbGwz.hGnmLIyhTqh.IcwW.GiDLVExlDlix5S1LXIWVsSyrQ==\"],\"assets\":[{\"id\":1,\"data\":{\"value\":\"ImproveDigital\",\"type\":1}},{\"id\":3,\"data\":{\"value\":\"Test content.\",\"type\":2}},{\"id\":0,\"title\":{\"text\":\"Sample Prebid Test Title\"}}],\"link\":{\"url\":\"https://euw-ice.360yield.com/click/hcUBlHOV7YhVse8RyBa0ajjyPa9Vt17e4g-1m3cRj3E67vq-RYux.SiUeAmBfNBcoOqkUc6A15AWmi4yFu5K-BdkaYjildyyk7fNLyR6hWr411kv4vrFwm5jrIBceuHS6K8oN69f.uCo8zGTdR2TbSlldwcpahQPlufZU.6VaMsu4IC53uEiUT5vb7kAw6TTlxuGBNq6zaGryiWEV2.N3YYJDTyYPh8tv-ZFyeFZFm0Gnjv.xWbC.70JcRUVU9UelQaPsTpTWYTXBhJt84YJUw1-GNtaLNVLSjjZbVoA2fsMti5p6OBmF.7u39on2OPgvseIkSmge7Pqg63pRqdP75hp.DAEk6OkcN1jGnwP2DSbvpaSbin5lVqjfO0B-wnQgfQTCUtM5v4JmkNweLhUf9Q-x.nPKLW5SccEk9ZFXzY2-1wpT3PWm8Tix3NRscLPZub9wHzL..pl6ip8cQ9hp16UjwT4H6RMAxL0R7bl-h2pAicGAzYmuO7ntRESKUoIWA==//http%3A%2F%2Fquantum-advertising.com%2Ffr%2F\"},\"jstracker\":\"<script type=\\\"application/javascript\\\">var js_tracker = ['https://secure.adnxs.com/imptr?id=52312&t=1', 'https://pixel.adsafeprotected.com/rjss/st/291611/36974035/skeleton.js?ias_adpath=[class~=ea_improve_pid_${TAG_ID}]']</script>\"}",
944
954
  'impid': '33e9500b21129f',
945
955
  'cid': '196108'
946
956
  }
@@ -968,7 +978,6 @@ describe('Improve Digital Adapter Tests', function () {
968
978
  'agency_id': '0'
969
979
  }
970
980
  },
971
- 'exp': 120,
972
981
  'crid': '484367',
973
982
  'price': 9.600271769901472,
974
983
  'id': 'b131fd7b-5759-4b72-800e-60e69291e7d9',
@@ -1012,7 +1021,6 @@ describe('Improve Digital Adapter Tests', function () {
1012
1021
  'agency_id': '0'
1013
1022
  }
1014
1023
  },
1015
- 'exp': 120,
1016
1024
  'crid': '544063',
1017
1025
  'price': 1.9199364935359489,
1018
1026
  'id': '1fcf4dd8-a783-48ed-b59c-8fc8eeccb024',
@@ -1041,20 +1049,17 @@ describe('Improve Digital Adapter Tests', function () {
1041
1049
  width: 728,
1042
1050
  height: 90,
1043
1051
  ttl: 300,
1044
- ad: '<html><body style="margin:0%"><script>window.__razr_config = {"prebid":{"bidRequest":{"bidder":"improvedigital","params":{"placementId":1053688,"keyValues":{"testKey":["testValue"]},"bidFloor":0.05,"bidFloorCur":"eUR","size":{"w":800,"h":600}},"adUnitCode":"div-gpt-ad-1499748733608-0","transactionId":"f183e871-fbed-45f0-a427-c8a63c4c01eb","bidId":"33e9500b21129f","bidderRequestId":"2772c1e566670b","auctionId":"192721e36a0239","mediaTypes":{"banner":{"sizes":[[300,250],[160,600]]}},"sizes":[[300,250],[160,600]]},"bid":{"requestId":"33e9500b21129f","cpm":1.9200543539802946,"creativeId":"510265","currency":"EUR","dealId":320896,"meta":{"advertiserDomains":[]},"netRevenue":false,"ttl":300,"mediaType":"banner","ad":"<html><body style=\\"margin:0%\\"><a href=\\"https://na-ice.360yield.com/click/wIUgWAXQ-Teg9bFreqmjvvwpXD86tInZbesBQgOtGBHqZatmIY9C1mo-1kWRx32zN2mfOxtmyaaHpr.Qh5pspzJarrsm08TtkRSeTc2mnsRuQ2MKzCTvbospesMJR28YLZ.3g06DwS6c5XOJuesd0eODk7GCqtmJ18c6CTmdWDUdDxiknLAPHVXAfvlDH5AA9utF7TNNGjaxvyMpQD51.Dt5GFjcJLnwWnGSajoSr9JfomoGenbLkabLmzylSXd1p9xyrzTmWU39FvagEOZnMb2ixlc.JDxXA1ZnaR.e7ywkwiJnDtg1Om0EJAYOmUh0oTozbXeo26iwLLZxVxV0owOHY61zhHYyHcpBakqtelYPWZcmBJEXfl5KIekB2CiLQqxCi3TKdg5FztAQY0Tf3mTmiGZev0RkeiX5fnxS8jbWSD-cCgB51PNLn0X5EEkUPkOJh9JV713OOcyDhsgaFPezUcvuD7nNrxB71aWcH6MMfk1BFQ7kSVi9WHQvauaTxrWm//https%3A%2F%2Fazerion.com\\" target=\\"_blank\\"><img style=\\"border: 0;\\" border=\\"0\\" width=728 height=90 src=\\"https://creative.360yield.com/file/241121/728x90.jpg\\" alt=\\" \\"/></a><img src=\\"https://na-ice.360yield.com/imp_pixel?ic=wIUgWDjQ.pQrjtYOEKs44M3pIqNnfojBPkSd3WRdHnRawHiRiER7A-0RowzsOtOLq7MWtEFnWsRXYZZmJcZPGft0cNSs8lNOVZnXWHLDv3Dyqo8VGI4737RieGIK0DrIjlVXzFmuYeXufriRfPHVGiV-hz6VIateQ6I7.xR5O.48..ZoEGfRpIJGzqeqz12cWnFUPhBScQ6sPLlb6B1RiTpNh170OhIVfX80N2g4jn-U.xJ262ND29bBvImQsJjz29o8mmGL3TfbzUHzr.ob-ozfP9.ZHh.B5tD-M5qG9rAlIU6Q7I-zchnhv1W5OzU5mfMYy9yMLKqBemQGJA1KaiZJV79lwnDki-6PIg1v09h86eJqXYHHsUobx4Np5lMT6-5UdHXZPpR8T08b4keLREQw-lpqKum92pwUCVAYPeFdmTeKk1gUKPcaWxN8QfaQeoLJfb.88n3-vp.-aBCkxlZwXjXSd55QV.uwi-bTtFwaZjGHpNkIBG3D19kNl.Yb55Rk\\" alt=\\" \\" style=\\"display:none\\"/><improvedigital_ad_output_information tp_id=\\"\\" buyer_id=\\"0\\" rtb_advertiser=\\"\\" campaign_id=\\"123159\\" line_item_id=\\"320896\\" creative_id=\\"510265\\" crid=\\"0\\" placement_id=\\"22135702\\"></improvedigital_ad_output_information></body></html>","width":728,"height":90}}};</script><a href="https://na-ice.360yield.com/click/wIUgWAXQ-Teg9bFreqmjvvwpXD86tInZbesBQgOtGBHqZatmIY9C1mo-1kWRx32zN2mfOxtmyaaHpr.Qh5pspzJarrsm08TtkRSeTc2mnsRuQ2MKzCTvbospesMJR28YLZ.3g06DwS6c5XOJuesd0eODk7GCqtmJ18c6CTmdWDUdDxiknLAPHVXAfvlDH5AA9utF7TNNGjaxvyMpQD51.Dt5GFjcJLnwWnGSajoSr9JfomoGenbLkabLmzylSXd1p9xyrzTmWU39FvagEOZnMb2ixlc.JDxXA1ZnaR.e7ywkwiJnDtg1Om0EJAYOmUh0oTozbXeo26iwLLZxVxV0owOHY61zhHYyHcpBakqtelYPWZcmBJEXfl5KIekB2CiLQqxCi3TKdg5FztAQY0Tf3mTmiGZev0RkeiX5fnxS8jbWSD-cCgB51PNLn0X5EEkUPkOJh9JV713OOcyDhsgaFPezUcvuD7nNrxB71aWcH6MMfk1BFQ7kSVi9WHQvauaTxrWm//https%3A%2F%2Fazerion.com" target="_blank"><img style="border: 0;" border="0" width=728 height=90 src="https://creative.360yield.com/file/241121/728x90.jpg" alt=" "/></a><img src="https://na-ice.360yield.com/imp_pixel?ic=wIUgWDjQ.pQrjtYOEKs44M3pIqNnfojBPkSd3WRdHnRawHiRiER7A-0RowzsOtOLq7MWtEFnWsRXYZZmJcZPGft0cNSs8lNOVZnXWHLDv3Dyqo8VGI4737RieGIK0DrIjlVXzFmuYeXufriRfPHVGiV-hz6VIateQ6I7.xR5O.48..ZoEGfRpIJGzqeqz12cWnFUPhBScQ6sPLlb6B1RiTpNh170OhIVfX80N2g4jn-U.xJ262ND29bBvImQsJjz29o8mmGL3TfbzUHzr.ob-ozfP9.ZHh.B5tD-M5qG9rAlIU6Q7I-zchnhv1W5OzU5mfMYy9yMLKqBemQGJA1KaiZJV79lwnDki-6PIg1v09h86eJqXYHHsUobx4Np5lMT6-5UdHXZPpR8T08b4keLREQw-lpqKum92pwUCVAYPeFdmTeKk1gUKPcaWxN8QfaQeoLJfb.88n3-vp.-aBCkxlZwXjXSd55QV.uwi-bTtFwaZjGHpNkIBG3D19kNl.Yb55Rk" alt=" " style="display:none"/><improvedigital_ad_output_information tp_id="" buyer_id="0" rtb_advertiser="" campaign_id="123159" line_item_id="320896" creative_id="510265" crid="0" placement_id="22135702"></improvedigital_ad_output_information></body></html>',
1052
+ ad: '<html><body style="margin:0%">\x3Cscript>window.__razr_config = {"prebid":{"bidRequest":{"bidder":"improvedigital","params":{"placementId":1053688,"keyValues":{"testKey":["testValue"]},"bidFloor":0.05,"bidFloorCur":"eUR","size":{"w":800,"h":600}},"adUnitCode":"div-gpt-ad-1499748733608-0","transactionId":"f183e871-fbed-45f0-a427-c8a63c4c01eb","bidId":"33e9500b21129f","bidderRequestId":"2772c1e566670b","auctionId":"192721e36a0239","mediaTypes":{"banner":{"sizes":[[300,250],[160,600]]}},"sizes":[[300,250],[160,600]]},"bid":{"mediaType":"banner","ad":"<html><body style=\\"margin:0%\\"><a href=\\"https://na-ice.360yield.com/click/wIUgWAXQ-Teg9bFreqmjvvwpXD86tInZbesBQgOtGBHqZatmIY9C1mo-1kWRx32zN2mfOxtmyaaHpr.Qh5pspzJarrsm08TtkRSeTc2mnsRuQ2MKzCTvbospesMJR28YLZ.3g06DwS6c5XOJuesd0eODk7GCqtmJ18c6CTmdWDUdDxiknLAPHVXAfvlDH5AA9utF7TNNGjaxvyMpQD51.Dt5GFjcJLnwWnGSajoSr9JfomoGenbLkabLmzylSXd1p9xyrzTmWU39FvagEOZnMb2ixlc.JDxXA1ZnaR.e7ywkwiJnDtg1Om0EJAYOmUh0oTozbXeo26iwLLZxVxV0owOHY61zhHYyHcpBakqtelYPWZcmBJEXfl5KIekB2CiLQqxCi3TKdg5FztAQY0Tf3mTmiGZev0RkeiX5fnxS8jbWSD-cCgB51PNLn0X5EEkUPkOJh9JV713OOcyDhsgaFPezUcvuD7nNrxB71aWcH6MMfk1BFQ7kSVi9WHQvauaTxrWm//https%3A%2F%2Fazerion.com\\" target=\\"_blank\\"><img style=\\"border: 0;\\" border=\\"0\\" width=728 height=90 src=\\"https://creative.360yield.com/file/241121/728x90.jpg\\" alt=\\" \\"/></a><img src=\\"https://na-ice.360yield.com/imp_pixel?ic=wIUgWDjQ.pQrjtYOEKs44M3pIqNnfojBPkSd3WRdHnRawHiRiER7A-0RowzsOtOLq7MWtEFnWsRXYZZmJcZPGft0cNSs8lNOVZnXWHLDv3Dyqo8VGI4737RieGIK0DrIjlVXzFmuYeXufriRfPHVGiV-hz6VIateQ6I7.xR5O.48..ZoEGfRpIJGzqeqz12cWnFUPhBScQ6sPLlb6B1RiTpNh170OhIVfX80N2g4jn-U.xJ262ND29bBvImQsJjz29o8mmGL3TfbzUHzr.ob-ozfP9.ZHh.B5tD-M5qG9rAlIU6Q7I-zchnhv1W5OzU5mfMYy9yMLKqBemQGJA1KaiZJV79lwnDki-6PIg1v09h86eJqXYHHsUobx4Np5lMT6-5UdHXZPpR8T08b4keLREQw-lpqKum92pwUCVAYPeFdmTeKk1gUKPcaWxN8QfaQeoLJfb.88n3-vp.-aBCkxlZwXjXSd55QV.uwi-bTtFwaZjGHpNkIBG3D19kNl.Yb55Rk\\" alt=\\" \\" style=\\"display:none\\"/><improvedigital_ad_output_information tp_id=\\"\\" buyer_id=\\"0\\" rtb_advertiser=\\"\\" campaign_id=\\"123159\\" line_item_id=\\"320896\\" creative_id=\\"510265\\" crid=\\"0\\" placement_id=\\"22135702\\"></improvedigital_ad_output_information></body></html>","requestId":"33e9500b21129f","seatBidId":"35adfe19-d6e9-46b9-9f7d-20da7026b965","cpm":1.9200543539802946,"currency":"EUR","width":728,"height":90,"creative_id":"510265","creativeId":"510265","ttl":300,"meta":{},"dealId":320896,"netRevenue":false}}};\x3C/script><a href="https://na-ice.360yield.com/click/wIUgWAXQ-Teg9bFreqmjvvwpXD86tInZbesBQgOtGBHqZatmIY9C1mo-1kWRx32zN2mfOxtmyaaHpr.Qh5pspzJarrsm08TtkRSeTc2mnsRuQ2MKzCTvbospesMJR28YLZ.3g06DwS6c5XOJuesd0eODk7GCqtmJ18c6CTmdWDUdDxiknLAPHVXAfvlDH5AA9utF7TNNGjaxvyMpQD51.Dt5GFjcJLnwWnGSajoSr9JfomoGenbLkabLmzylSXd1p9xyrzTmWU39FvagEOZnMb2ixlc.JDxXA1ZnaR.e7ywkwiJnDtg1Om0EJAYOmUh0oTozbXeo26iwLLZxVxV0owOHY61zhHYyHcpBakqtelYPWZcmBJEXfl5KIekB2CiLQqxCi3TKdg5FztAQY0Tf3mTmiGZev0RkeiX5fnxS8jbWSD-cCgB51PNLn0X5EEkUPkOJh9JV713OOcyDhsgaFPezUcvuD7nNrxB71aWcH6MMfk1BFQ7kSVi9WHQvauaTxrWm//https%3A%2F%2Fazerion.com" target="_blank"><img style="border: 0;" border="0" width=728 height=90 src="https://creative.360yield.com/file/241121/728x90.jpg" alt=" "/></a><img src="https://na-ice.360yield.com/imp_pixel?ic=wIUgWDjQ.pQrjtYOEKs44M3pIqNnfojBPkSd3WRdHnRawHiRiER7A-0RowzsOtOLq7MWtEFnWsRXYZZmJcZPGft0cNSs8lNOVZnXWHLDv3Dyqo8VGI4737RieGIK0DrIjlVXzFmuYeXufriRfPHVGiV-hz6VIateQ6I7.xR5O.48..ZoEGfRpIJGzqeqz12cWnFUPhBScQ6sPLlb6B1RiTpNh170OhIVfX80N2g4jn-U.xJ262ND29bBvImQsJjz29o8mmGL3TfbzUHzr.ob-ozfP9.ZHh.B5tD-M5qG9rAlIU6Q7I-zchnhv1W5OzU5mfMYy9yMLKqBemQGJA1KaiZJV79lwnDki-6PIg1v09h86eJqXYHHsUobx4Np5lMT6-5UdHXZPpR8T08b4keLREQw-lpqKum92pwUCVAYPeFdmTeKk1gUKPcaWxN8QfaQeoLJfb.88n3-vp.-aBCkxlZwXjXSd55QV.uwi-bTtFwaZjGHpNkIBG3D19kNl.Yb55Rk" alt=" " style="display:none"/><improvedigital_ad_output_information tp_id="" buyer_id="0" rtb_advertiser="" campaign_id="123159" line_item_id="320896" creative_id="510265" crid="0" placement_id="22135702"></improvedigital_ad_output_information></body></html>',
1045
1053
  creativeId: '510265',
1046
1054
  dealId: 320896,
1047
1055
  netRevenue: false,
1048
1056
  mediaType: BANNER,
1049
- meta: {
1050
- advertiserDomains: []
1051
- }
1052
1057
  }
1053
1058
  ];
1054
1059
 
1055
1060
  const multiFormatExpectedBid = [
1056
1061
  Object.assign({}, expectedBid[0], {
1057
- ad: '<html><body style="margin:0%"><script>window.__razr_config = {"prebid":{"bidRequest":{"bidder":"improvedigital","params":{"placementId":1053688},"adUnitCode":"div-gpt-ad-1499748733608-0","transactionId":"f183e871-fbed-45f0-a427-c8a63c4c01eb","bidId":"33e9500b21129f","bidderRequestId":"2772c1e566670b","auctionId":"192721e36a0239","mediaTypes":{"banner":{"sizes":[[300,250],[160,600]]},"native":{},"video":{"context":"outstream","playerSize":[640,480]}},"sizes":[[300,250],[160,600]],"nativeParams":{"body":{"required":true}}},"bid":{"requestId":"33e9500b21129f","cpm":1.9200543539802946,"creativeId":"510265","currency":"EUR","dealId":320896,"meta":{"advertiserDomains":[]},"netRevenue":false,"ttl":300,"mediaType":"banner","ad":"<html><body style=\\"margin:0%\\"><a href=\\"https://na-ice.360yield.com/click/wIUgWAXQ-Teg9bFreqmjvvwpXD86tInZbesBQgOtGBHqZatmIY9C1mo-1kWRx32zN2mfOxtmyaaHpr.Qh5pspzJarrsm08TtkRSeTc2mnsRuQ2MKzCTvbospesMJR28YLZ.3g06DwS6c5XOJuesd0eODk7GCqtmJ18c6CTmdWDUdDxiknLAPHVXAfvlDH5AA9utF7TNNGjaxvyMpQD51.Dt5GFjcJLnwWnGSajoSr9JfomoGenbLkabLmzylSXd1p9xyrzTmWU39FvagEOZnMb2ixlc.JDxXA1ZnaR.e7ywkwiJnDtg1Om0EJAYOmUh0oTozbXeo26iwLLZxVxV0owOHY61zhHYyHcpBakqtelYPWZcmBJEXfl5KIekB2CiLQqxCi3TKdg5FztAQY0Tf3mTmiGZev0RkeiX5fnxS8jbWSD-cCgB51PNLn0X5EEkUPkOJh9JV713OOcyDhsgaFPezUcvuD7nNrxB71aWcH6MMfk1BFQ7kSVi9WHQvauaTxrWm//https%3A%2F%2Fazerion.com\\" target=\\"_blank\\"><img style=\\"border: 0;\\" border=\\"0\\" width=728 height=90 src=\\"https://creative.360yield.com/file/241121/728x90.jpg\\" alt=\\" \\"/></a><img src=\\"https://na-ice.360yield.com/imp_pixel?ic=wIUgWDjQ.pQrjtYOEKs44M3pIqNnfojBPkSd3WRdHnRawHiRiER7A-0RowzsOtOLq7MWtEFnWsRXYZZmJcZPGft0cNSs8lNOVZnXWHLDv3Dyqo8VGI4737RieGIK0DrIjlVXzFmuYeXufriRfPHVGiV-hz6VIateQ6I7.xR5O.48..ZoEGfRpIJGzqeqz12cWnFUPhBScQ6sPLlb6B1RiTpNh170OhIVfX80N2g4jn-U.xJ262ND29bBvImQsJjz29o8mmGL3TfbzUHzr.ob-ozfP9.ZHh.B5tD-M5qG9rAlIU6Q7I-zchnhv1W5OzU5mfMYy9yMLKqBemQGJA1KaiZJV79lwnDki-6PIg1v09h86eJqXYHHsUobx4Np5lMT6-5UdHXZPpR8T08b4keLREQw-lpqKum92pwUCVAYPeFdmTeKk1gUKPcaWxN8QfaQeoLJfb.88n3-vp.-aBCkxlZwXjXSd55QV.uwi-bTtFwaZjGHpNkIBG3D19kNl.Yb55Rk\\" alt=\\" \\" style=\\"display:none\\"/><improvedigital_ad_output_information tp_id=\\"\\" buyer_id=\\"0\\" rtb_advertiser=\\"\\" campaign_id=\\"123159\\" line_item_id=\\"320896\\" creative_id=\\"510265\\" crid=\\"0\\" placement_id=\\"22135702\\"></improvedigital_ad_output_information></body></html>","width":728,"height":90}}};</script><a href="https://na-ice.360yield.com/click/wIUgWAXQ-Teg9bFreqmjvvwpXD86tInZbesBQgOtGBHqZatmIY9C1mo-1kWRx32zN2mfOxtmyaaHpr.Qh5pspzJarrsm08TtkRSeTc2mnsRuQ2MKzCTvbospesMJR28YLZ.3g06DwS6c5XOJuesd0eODk7GCqtmJ18c6CTmdWDUdDxiknLAPHVXAfvlDH5AA9utF7TNNGjaxvyMpQD51.Dt5GFjcJLnwWnGSajoSr9JfomoGenbLkabLmzylSXd1p9xyrzTmWU39FvagEOZnMb2ixlc.JDxXA1ZnaR.e7ywkwiJnDtg1Om0EJAYOmUh0oTozbXeo26iwLLZxVxV0owOHY61zhHYyHcpBakqtelYPWZcmBJEXfl5KIekB2CiLQqxCi3TKdg5FztAQY0Tf3mTmiGZev0RkeiX5fnxS8jbWSD-cCgB51PNLn0X5EEkUPkOJh9JV713OOcyDhsgaFPezUcvuD7nNrxB71aWcH6MMfk1BFQ7kSVi9WHQvauaTxrWm//https%3A%2F%2Fazerion.com" target="_blank"><img style="border: 0;" border="0" width=728 height=90 src="https://creative.360yield.com/file/241121/728x90.jpg" alt=" "/></a><img src="https://na-ice.360yield.com/imp_pixel?ic=wIUgWDjQ.pQrjtYOEKs44M3pIqNnfojBPkSd3WRdHnRawHiRiER7A-0RowzsOtOLq7MWtEFnWsRXYZZmJcZPGft0cNSs8lNOVZnXWHLDv3Dyqo8VGI4737RieGIK0DrIjlVXzFmuYeXufriRfPHVGiV-hz6VIateQ6I7.xR5O.48..ZoEGfRpIJGzqeqz12cWnFUPhBScQ6sPLlb6B1RiTpNh170OhIVfX80N2g4jn-U.xJ262ND29bBvImQsJjz29o8mmGL3TfbzUHzr.ob-ozfP9.ZHh.B5tD-M5qG9rAlIU6Q7I-zchnhv1W5OzU5mfMYy9yMLKqBemQGJA1KaiZJV79lwnDki-6PIg1v09h86eJqXYHHsUobx4Np5lMT6-5UdHXZPpR8T08b4keLREQw-lpqKum92pwUCVAYPeFdmTeKk1gUKPcaWxN8QfaQeoLJfb.88n3-vp.-aBCkxlZwXjXSd55QV.uwi-bTtFwaZjGHpNkIBG3D19kNl.Yb55Rk" alt=" " style="display:none"/><improvedigital_ad_output_information tp_id="" buyer_id="0" rtb_advertiser="" campaign_id="123159" line_item_id="320896" creative_id="510265" crid="0" placement_id="22135702"></improvedigital_ad_output_information></body></html>'
1062
+ ad: '<html><body style="margin:0%">\x3Cscript>window.__razr_config = {"prebid":{"bidRequest":{"bidder":"improvedigital","params":{"placementId":1053688},"adUnitCode":"div-gpt-ad-1499748733608-0","transactionId":"f183e871-fbed-45f0-a427-c8a63c4c01eb","bidId":"33e9500b21129f","bidderRequestId":"2772c1e566670b","auctionId":"192721e36a0239","mediaTypes":{"banner":{"sizes":[[300,250],[160,600]]},"native":{},"video":{"context":"outstream","playerSize":[640,480]}},"sizes":[[300,250],[160,600]],"nativeParams":{"body":{"required":true}}},"bid":{"mediaType":"banner","ad":"<html><body style=\\"margin:0%\\"><a href=\\"https://na-ice.360yield.com/click/wIUgWAXQ-Teg9bFreqmjvvwpXD86tInZbesBQgOtGBHqZatmIY9C1mo-1kWRx32zN2mfOxtmyaaHpr.Qh5pspzJarrsm08TtkRSeTc2mnsRuQ2MKzCTvbospesMJR28YLZ.3g06DwS6c5XOJuesd0eODk7GCqtmJ18c6CTmdWDUdDxiknLAPHVXAfvlDH5AA9utF7TNNGjaxvyMpQD51.Dt5GFjcJLnwWnGSajoSr9JfomoGenbLkabLmzylSXd1p9xyrzTmWU39FvagEOZnMb2ixlc.JDxXA1ZnaR.e7ywkwiJnDtg1Om0EJAYOmUh0oTozbXeo26iwLLZxVxV0owOHY61zhHYyHcpBakqtelYPWZcmBJEXfl5KIekB2CiLQqxCi3TKdg5FztAQY0Tf3mTmiGZev0RkeiX5fnxS8jbWSD-cCgB51PNLn0X5EEkUPkOJh9JV713OOcyDhsgaFPezUcvuD7nNrxB71aWcH6MMfk1BFQ7kSVi9WHQvauaTxrWm//https%3A%2F%2Fazerion.com\\" target=\\"_blank\\"><img style=\\"border: 0;\\" border=\\"0\\" width=728 height=90 src=\\"https://creative.360yield.com/file/241121/728x90.jpg\\" alt=\\" \\"/></a><img src=\\"https://na-ice.360yield.com/imp_pixel?ic=wIUgWDjQ.pQrjtYOEKs44M3pIqNnfojBPkSd3WRdHnRawHiRiER7A-0RowzsOtOLq7MWtEFnWsRXYZZmJcZPGft0cNSs8lNOVZnXWHLDv3Dyqo8VGI4737RieGIK0DrIjlVXzFmuYeXufriRfPHVGiV-hz6VIateQ6I7.xR5O.48..ZoEGfRpIJGzqeqz12cWnFUPhBScQ6sPLlb6B1RiTpNh170OhIVfX80N2g4jn-U.xJ262ND29bBvImQsJjz29o8mmGL3TfbzUHzr.ob-ozfP9.ZHh.B5tD-M5qG9rAlIU6Q7I-zchnhv1W5OzU5mfMYy9yMLKqBemQGJA1KaiZJV79lwnDki-6PIg1v09h86eJqXYHHsUobx4Np5lMT6-5UdHXZPpR8T08b4keLREQw-lpqKum92pwUCVAYPeFdmTeKk1gUKPcaWxN8QfaQeoLJfb.88n3-vp.-aBCkxlZwXjXSd55QV.uwi-bTtFwaZjGHpNkIBG3D19kNl.Yb55Rk\\" alt=\\" \\" style=\\"display:none\\"/><improvedigital_ad_output_information tp_id=\\"\\" buyer_id=\\"0\\" rtb_advertiser=\\"\\" campaign_id=\\"123159\\" line_item_id=\\"320896\\" creative_id=\\"510265\\" crid=\\"0\\" placement_id=\\"22135702\\"></improvedigital_ad_output_information></body></html>","requestId":"33e9500b21129f","seatBidId":"35adfe19-d6e9-46b9-9f7d-20da7026b965","cpm":1.9200543539802946,"currency":"EUR","width":728,"height":90,"creative_id":"510265","creativeId":"510265","ttl":300,"meta":{},"dealId":320896,"netRevenue":false}}};\x3C/script><a href="https://na-ice.360yield.com/click/wIUgWAXQ-Teg9bFreqmjvvwpXD86tInZbesBQgOtGBHqZatmIY9C1mo-1kWRx32zN2mfOxtmyaaHpr.Qh5pspzJarrsm08TtkRSeTc2mnsRuQ2MKzCTvbospesMJR28YLZ.3g06DwS6c5XOJuesd0eODk7GCqtmJ18c6CTmdWDUdDxiknLAPHVXAfvlDH5AA9utF7TNNGjaxvyMpQD51.Dt5GFjcJLnwWnGSajoSr9JfomoGenbLkabLmzylSXd1p9xyrzTmWU39FvagEOZnMb2ixlc.JDxXA1ZnaR.e7ywkwiJnDtg1Om0EJAYOmUh0oTozbXeo26iwLLZxVxV0owOHY61zhHYyHcpBakqtelYPWZcmBJEXfl5KIekB2CiLQqxCi3TKdg5FztAQY0Tf3mTmiGZev0RkeiX5fnxS8jbWSD-cCgB51PNLn0X5EEkUPkOJh9JV713OOcyDhsgaFPezUcvuD7nNrxB71aWcH6MMfk1BFQ7kSVi9WHQvauaTxrWm//https%3A%2F%2Fazerion.com" target="_blank"><img style="border: 0;" border="0" width=728 height=90 src="https://creative.360yield.com/file/241121/728x90.jpg" alt=" "/></a><img src="https://na-ice.360yield.com/imp_pixel?ic=wIUgWDjQ.pQrjtYOEKs44M3pIqNnfojBPkSd3WRdHnRawHiRiER7A-0RowzsOtOLq7MWtEFnWsRXYZZmJcZPGft0cNSs8lNOVZnXWHLDv3Dyqo8VGI4737RieGIK0DrIjlVXzFmuYeXufriRfPHVGiV-hz6VIateQ6I7.xR5O.48..ZoEGfRpIJGzqeqz12cWnFUPhBScQ6sPLlb6B1RiTpNh170OhIVfX80N2g4jn-U.xJ262ND29bBvImQsJjz29o8mmGL3TfbzUHzr.ob-ozfP9.ZHh.B5tD-M5qG9rAlIU6Q7I-zchnhv1W5OzU5mfMYy9yMLKqBemQGJA1KaiZJV79lwnDki-6PIg1v09h86eJqXYHHsUobx4Np5lMT6-5UdHXZPpR8T08b4keLREQw-lpqKum92pwUCVAYPeFdmTeKk1gUKPcaWxN8QfaQeoLJfb.88n3-vp.-aBCkxlZwXjXSd55QV.uwi-bTtFwaZjGHpNkIBG3D19kNl.Yb55Rk" alt=" " style="display:none"/><improvedigital_ad_output_information tp_id="" buyer_id="0" rtb_advertiser="" campaign_id="123159" line_item_id="320896" creative_id="510265" crid="0" placement_id="22135702"></improvedigital_ad_output_information></body></html>',
1058
1063
  })
1059
1064
  ];
1060
1065
 
@@ -1067,14 +1072,11 @@ describe('Improve Digital Adapter Tests', function () {
1067
1072
  width: 300,
1068
1073
  height: 250,
1069
1074
  ttl: 300,
1070
- ad: '<html><body style="margin:0%"><script>window.__razr_config = {"prebid":{"bidRequest":{"bidder":"improvedigital","params":{"placementId":1053688,"keyValues":{"testKey":["testValue"]},"bidFloor":0.05,"bidFloorCur":"eUR","size":{"w":800,"h":600}},"adUnitCode":"div-gpt-ad-1499748733608-0","transactionId":"f183e871-fbed-45f0-a427-c8a63c4c01eb","bidId":"33e9500b21129f","bidderRequestId":"2772c1e566670b","auctionId":"192721e36a0239","mediaTypes":{"banner":{"sizes":[[300,250],[160,600]]}},"sizes":[[300,250],[160,600]]},"bid":{"requestId":"33e9500b21129f","cpm":1.9200543539802946,"creativeId":"479163","currency":"EUR","dealId":320896,"meta":{"advertiserDomains":[]},"netRevenue":false,"ttl":300,"mediaType":"banner","ad":"<html><body style=\\"margin:0%\\"><a href=\\"https://na-ice.360yield.com/click/.2RC3VhfEsdhtcsRiT8bWksMTmBbkfnj1AaD3C6Bht.Bp85KK5vjzZvJMpigI4ECdhllWuzbk2UhQt8VEGq1tg8m1OEot7Gs94PplWYs2ESdXpGAPFHiqdbZstOOhfiWL4D.k6lXfgNmbRhpL.SktYeEAiRaOZHQAX.22IEQ0swRnEdNyjHXYEkNIgpvMLqkZTv.JYM.iW9NwyJLIqk4Djh8X301iRLxexGBTl7-.n93WbkSCVY6uwdXSzoQrtK1r3fTrS34rdgpqFt6ZIBLKWI2ByLM2.aQqfvev5BCMOeyEKY8CcSg9SoDiPyQsvcz9bTckLtqs3AD3Qu8I.2rGn1NID7ljgg6-dERrorPK9A5XK67Pv34UqUe2xILQ6wvi52dX4p5d3yxsI9BMfnxzkn7MullVJdn-NiSB2rTe2MFozJc5G1nEwtpsMwZpBxl00PCcMsyETtaKbhqa3Gq5nCuce4AEhL6109IrZscUUzBMSKLSX16HlFfmPZ.gDnWCI3lO35UbGdL7lKjbT9mHYQ-//http%3A%2F%2Fblah.com\\" target=\\"_blank\\"><img style=\\"border: 0;\\" border=\\"0\\" width=300 height=250 src=\\"https://creative.360yield.com/file/238052/test_ads-300x250.jpg\\" alt=\\" \\"/></a><img src=\\"https://na-ice.360yield.com/imp_pixel?ic=.2RC3VqxeCtOU3G5i6Wejh69dm5JnKlRXeieMtJA63nfGMyuFoWTTjSU5PfHLg2PtnmDRFgHJgGE19QyjAGj6ZQVy0iUk-HF-.zsAlx.7Fx3m5fPE7RIYw.kjy-BvuprFqfU-qlm03KTks6zVLDSIspuxemNQ1HBhq6QZSm9qqAVY-1XS-KbImfb.fll3VvhJXy7Ru.KstgDfAJwt5vYxVab6efvjAIhOrrv6uXaywFVTtu9-gK5pKgIkdixxuYE2jLUyEh9GiRyRCH0jhhUVUmSfrjE4OuTq-7TmCYXQQ5Vk9AqOV.JybF8d35IeyAbF2aywwdZA2SGGEGeYIoOy.7D8TpuVqXxvnUyeKXlCfmzXcJs27W2sKGUTfpWc-TyhAOHKzwqrxP-QN5D1QRCXFWgAm.rwUBguE-oL1Q7NOaCsaRwINRwvQrastWNFUDEYzrB32NL-wIkILdh9e96JwhKiwGwJ1VqH.6RDDutUi9CLreYQl348exTfqL44Ia5VTLn7e0rA6s9V1tg55V7TX36\\" alt=\\" \\" style=\\"display:none\\"/><improvedigital_ad_output_information tp_id=\\"\\" buyer_id=\\"0\\" rtb_advertiser=\\"\\" campaign_id=\\"123159\\" line_item_id=\\"320896\\" creative_id=\\"479163\\" crid=\\"0\\" placement_id=\\"22135702\\"></improvedigital_ad_output_information></body></html>","width":300,"height":250}}};</script><a href="https://na-ice.360yield.com/click/.2RC3VhfEsdhtcsRiT8bWksMTmBbkfnj1AaD3C6Bht.Bp85KK5vjzZvJMpigI4ECdhllWuzbk2UhQt8VEGq1tg8m1OEot7Gs94PplWYs2ESdXpGAPFHiqdbZstOOhfiWL4D.k6lXfgNmbRhpL.SktYeEAiRaOZHQAX.22IEQ0swRnEdNyjHXYEkNIgpvMLqkZTv.JYM.iW9NwyJLIqk4Djh8X301iRLxexGBTl7-.n93WbkSCVY6uwdXSzoQrtK1r3fTrS34rdgpqFt6ZIBLKWI2ByLM2.aQqfvev5BCMOeyEKY8CcSg9SoDiPyQsvcz9bTckLtqs3AD3Qu8I.2rGn1NID7ljgg6-dERrorPK9A5XK67Pv34UqUe2xILQ6wvi52dX4p5d3yxsI9BMfnxzkn7MullVJdn-NiSB2rTe2MFozJc5G1nEwtpsMwZpBxl00PCcMsyETtaKbhqa3Gq5nCuce4AEhL6109IrZscUUzBMSKLSX16HlFfmPZ.gDnWCI3lO35UbGdL7lKjbT9mHYQ-//http%3A%2F%2Fblah.com" target="_blank"><img style="border: 0;" border="0" width=300 height=250 src="https://creative.360yield.com/file/238052/test_ads-300x250.jpg" alt=" "/></a><img src="https://na-ice.360yield.com/imp_pixel?ic=.2RC3VqxeCtOU3G5i6Wejh69dm5JnKlRXeieMtJA63nfGMyuFoWTTjSU5PfHLg2PtnmDRFgHJgGE19QyjAGj6ZQVy0iUk-HF-.zsAlx.7Fx3m5fPE7RIYw.kjy-BvuprFqfU-qlm03KTks6zVLDSIspuxemNQ1HBhq6QZSm9qqAVY-1XS-KbImfb.fll3VvhJXy7Ru.KstgDfAJwt5vYxVab6efvjAIhOrrv6uXaywFVTtu9-gK5pKgIkdixxuYE2jLUyEh9GiRyRCH0jhhUVUmSfrjE4OuTq-7TmCYXQQ5Vk9AqOV.JybF8d35IeyAbF2aywwdZA2SGGEGeYIoOy.7D8TpuVqXxvnUyeKXlCfmzXcJs27W2sKGUTfpWc-TyhAOHKzwqrxP-QN5D1QRCXFWgAm.rwUBguE-oL1Q7NOaCsaRwINRwvQrastWNFUDEYzrB32NL-wIkILdh9e96JwhKiwGwJ1VqH.6RDDutUi9CLreYQl348exTfqL44Ia5VTLn7e0rA6s9V1tg55V7TX36" alt=" " style="display:none"/><improvedigital_ad_output_information tp_id="" buyer_id="0" rtb_advertiser="" campaign_id="123159" line_item_id="320896" creative_id="479163" crid="0" placement_id="22135702"></improvedigital_ad_output_information></body></html>',
1075
+ ad: '<html><body style="margin:0%">\x3Cscript>window.__razr_config = {"prebid":{"bidRequest":{"bidder":"improvedigital","params":{"placementId":1053688,"keyValues":{"testKey":["testValue"]},"bidFloor":0.05,"bidFloorCur":"eUR","size":{"w":800,"h":600}},"adUnitCode":"div-gpt-ad-1499748733608-0","transactionId":"f183e871-fbed-45f0-a427-c8a63c4c01eb","bidId":"33e9500b21129f","bidderRequestId":"2772c1e566670b","auctionId":"192721e36a0239","mediaTypes":{"banner":{"sizes":[[300,250],[160,600]]}},"sizes":[[300,250],[160,600]]},"bid":{"mediaType":"banner","ad":"<html><body style=\\"margin:0%\\"><a href=\\"https://na-ice.360yield.com/click/.2RC3VhfEsdhtcsRiT8bWksMTmBbkfnj1AaD3C6Bht.Bp85KK5vjzZvJMpigI4ECdhllWuzbk2UhQt8VEGq1tg8m1OEot7Gs94PplWYs2ESdXpGAPFHiqdbZstOOhfiWL4D.k6lXfgNmbRhpL.SktYeEAiRaOZHQAX.22IEQ0swRnEdNyjHXYEkNIgpvMLqkZTv.JYM.iW9NwyJLIqk4Djh8X301iRLxexGBTl7-.n93WbkSCVY6uwdXSzoQrtK1r3fTrS34rdgpqFt6ZIBLKWI2ByLM2.aQqfvev5BCMOeyEKY8CcSg9SoDiPyQsvcz9bTckLtqs3AD3Qu8I.2rGn1NID7ljgg6-dERrorPK9A5XK67Pv34UqUe2xILQ6wvi52dX4p5d3yxsI9BMfnxzkn7MullVJdn-NiSB2rTe2MFozJc5G1nEwtpsMwZpBxl00PCcMsyETtaKbhqa3Gq5nCuce4AEhL6109IrZscUUzBMSKLSX16HlFfmPZ.gDnWCI3lO35UbGdL7lKjbT9mHYQ-//http%3A%2F%2Fblah.com\\" target=\\"_blank\\"><img style=\\"border: 0;\\" border=\\"0\\" width=300 height=250 src=\\"https://creative.360yield.com/file/238052/test_ads-300x250.jpg\\" alt=\\" \\"/></a><img src=\\"https://na-ice.360yield.com/imp_pixel?ic=.2RC3VqxeCtOU3G5i6Wejh69dm5JnKlRXeieMtJA63nfGMyuFoWTTjSU5PfHLg2PtnmDRFgHJgGE19QyjAGj6ZQVy0iUk-HF-.zsAlx.7Fx3m5fPE7RIYw.kjy-BvuprFqfU-qlm03KTks6zVLDSIspuxemNQ1HBhq6QZSm9qqAVY-1XS-KbImfb.fll3VvhJXy7Ru.KstgDfAJwt5vYxVab6efvjAIhOrrv6uXaywFVTtu9-gK5pKgIkdixxuYE2jLUyEh9GiRyRCH0jhhUVUmSfrjE4OuTq-7TmCYXQQ5Vk9AqOV.JybF8d35IeyAbF2aywwdZA2SGGEGeYIoOy.7D8TpuVqXxvnUyeKXlCfmzXcJs27W2sKGUTfpWc-TyhAOHKzwqrxP-QN5D1QRCXFWgAm.rwUBguE-oL1Q7NOaCsaRwINRwvQrastWNFUDEYzrB32NL-wIkILdh9e96JwhKiwGwJ1VqH.6RDDutUi9CLreYQl348exTfqL44Ia5VTLn7e0rA6s9V1tg55V7TX36\\" alt=\\" \\" style=\\"display:none\\"/><improvedigital_ad_output_information tp_id=\\"\\" buyer_id=\\"0\\" rtb_advertiser=\\"\\" campaign_id=\\"123159\\" line_item_id=\\"320896\\" creative_id=\\"479163\\" crid=\\"0\\" placement_id=\\"22135702\\"></improvedigital_ad_output_information></body></html>","requestId":"33e9500b21129f","seatBidId":"83c8d524-0955-4d0c-b558-4c9f3600e09b","cpm":1.9200543539802946,"currency":"EUR","width":300,"height":250,"creative_id":"479163","creativeId":"479163","ttl":300,"meta":{},"dealId":320896,"netRevenue":false}}};\x3C/script><a href="https://na-ice.360yield.com/click/.2RC3VhfEsdhtcsRiT8bWksMTmBbkfnj1AaD3C6Bht.Bp85KK5vjzZvJMpigI4ECdhllWuzbk2UhQt8VEGq1tg8m1OEot7Gs94PplWYs2ESdXpGAPFHiqdbZstOOhfiWL4D.k6lXfgNmbRhpL.SktYeEAiRaOZHQAX.22IEQ0swRnEdNyjHXYEkNIgpvMLqkZTv.JYM.iW9NwyJLIqk4Djh8X301iRLxexGBTl7-.n93WbkSCVY6uwdXSzoQrtK1r3fTrS34rdgpqFt6ZIBLKWI2ByLM2.aQqfvev5BCMOeyEKY8CcSg9SoDiPyQsvcz9bTckLtqs3AD3Qu8I.2rGn1NID7ljgg6-dERrorPK9A5XK67Pv34UqUe2xILQ6wvi52dX4p5d3yxsI9BMfnxzkn7MullVJdn-NiSB2rTe2MFozJc5G1nEwtpsMwZpBxl00PCcMsyETtaKbhqa3Gq5nCuce4AEhL6109IrZscUUzBMSKLSX16HlFfmPZ.gDnWCI3lO35UbGdL7lKjbT9mHYQ-//http%3A%2F%2Fblah.com" target="_blank"><img style="border: 0;" border="0" width=300 height=250 src="https://creative.360yield.com/file/238052/test_ads-300x250.jpg" alt=" "/></a><img src="https://na-ice.360yield.com/imp_pixel?ic=.2RC3VqxeCtOU3G5i6Wejh69dm5JnKlRXeieMtJA63nfGMyuFoWTTjSU5PfHLg2PtnmDRFgHJgGE19QyjAGj6ZQVy0iUk-HF-.zsAlx.7Fx3m5fPE7RIYw.kjy-BvuprFqfU-qlm03KTks6zVLDSIspuxemNQ1HBhq6QZSm9qqAVY-1XS-KbImfb.fll3VvhJXy7Ru.KstgDfAJwt5vYxVab6efvjAIhOrrv6uXaywFVTtu9-gK5pKgIkdixxuYE2jLUyEh9GiRyRCH0jhhUVUmSfrjE4OuTq-7TmCYXQQ5Vk9AqOV.JybF8d35IeyAbF2aywwdZA2SGGEGeYIoOy.7D8TpuVqXxvnUyeKXlCfmzXcJs27W2sKGUTfpWc-TyhAOHKzwqrxP-QN5D1QRCXFWgAm.rwUBguE-oL1Q7NOaCsaRwINRwvQrastWNFUDEYzrB32NL-wIkILdh9e96JwhKiwGwJ1VqH.6RDDutUi9CLreYQl348exTfqL44Ia5VTLn7e0rA6s9V1tg55V7TX36" alt=" " style="display:none"/><improvedigital_ad_output_information tp_id="" buyer_id="0" rtb_advertiser="" campaign_id="123159" line_item_id="320896" creative_id="479163" crid="0" placement_id="22135702"></improvedigital_ad_output_information></body></html>',
1071
1076
  creativeId: '479163',
1072
1077
  dealId: 320896,
1073
1078
  netRevenue: false,
1074
1079
  mediaType: BANNER,
1075
- meta: {
1076
- advertiserDomains: []
1077
- }
1078
1080
  }
1079
1081
  ];
1080
1082
 
@@ -1100,93 +1102,106 @@ describe('Improve Digital Adapter Tests', function () {
1100
1102
  content: expectedBidOutstreamVideo[0].vastXml
1101
1103
  };
1102
1104
 
1105
+ function makeRequest(bidderRequest) {
1106
+ return {
1107
+ ortbRequest: CONVERTER.toORTB({bidderRequest})
1108
+ }
1109
+ }
1110
+
1111
+ function expectMatch(actual, expected) {
1112
+ sinon.assert.match(actual, expected.map(i => sinon.match(i)));
1113
+ }
1114
+
1103
1115
  it('should return a well-formed display bid', function () {
1104
- const bids = spec.interpretResponse(serverResponse, {bidderRequest});
1105
- expect(bids).to.deep.equal(expectedBid);
1116
+ const bids = spec.interpretResponse(serverResponse, makeRequest(bidderRequest));
1117
+ expectMatch(bids, expectedBid);
1106
1118
  });
1107
1119
 
1108
1120
  it('should return a well-formed display bid for multi-format ad unit', function () {
1109
- const bids = spec.interpretResponse(serverResponse, {bidderRequest: multiFormatBidderRequest});
1110
- expect(bids).to.deep.equal(multiFormatExpectedBid);
1121
+ const bids = spec.interpretResponse(serverResponse, makeRequest(multiFormatBidderRequest));
1122
+
1123
+ expectMatch(bids, multiFormatExpectedBid);
1111
1124
  });
1112
1125
 
1113
1126
  it('should return two bids', function () {
1114
- const bids = spec.interpretResponse(serverResponseTwoBids, {bidderRequest});
1115
- expect(bids).to.deep.equal(expectedTwoBids);
1127
+ const bids = spec.interpretResponse(serverResponseTwoBids, makeRequest(bidderRequest));
1128
+ expectMatch(bids, expectedTwoBids);
1116
1129
  });
1117
1130
 
1118
1131
  it('should set dealId correctly', function () {
1132
+ const request = makeRequest(bidderRequest);
1119
1133
  const response = deepClone(serverResponse);
1120
1134
  let bids;
1121
1135
 
1122
1136
  delete response.body.seatbid[0].bid[0].ext.improvedigital.line_item_id;
1123
1137
  response.body.seatbid[0].bid[0].ext.improvedigital.buying_type = 'deal_id';
1124
- bids = spec.interpretResponse(response, {bidderRequest});
1138
+ bids = spec.interpretResponse(response, request);
1125
1139
  expect(bids[0].dealId).to.not.exist;
1126
1140
 
1127
1141
  response.body.seatbid[0].bid[0].ext.improvedigital.line_item_id = 268515;
1128
1142
  delete response.body.seatbid[0].bid[0].ext.improvedigital.buying_type;
1129
- bids = spec.interpretResponse(response, {bidderRequest});
1143
+ bids = spec.interpretResponse(response, request);
1130
1144
  expect(bids[0].dealId).to.not.exist;
1131
1145
 
1132
1146
  response.body.seatbid[0].bid[0].ext.improvedigital.line_item_id = 268515;
1133
1147
  response.body.seatbid[0].bid[0].ext.improvedigital.buying_type = 'rtb';
1134
- bids = spec.interpretResponse(response, {bidderRequest});
1148
+ bids = spec.interpretResponse(response, request);
1135
1149
  expect(bids[0].dealId).to.not.exist;
1136
1150
 
1137
1151
  response.body.seatbid[0].bid[0].ext.improvedigital.line_item_id = 268515;
1138
1152
  response.body.seatbid[0].bid[0].ext.improvedigital.buying_type = 'classic';
1139
- bids = spec.interpretResponse(response, {bidderRequest});
1153
+ bids = spec.interpretResponse(response, request);
1140
1154
  expect(bids[0].dealId).to.equal(268515);
1141
1155
 
1142
1156
  response.body.seatbid[0].bid[0].ext.improvedigital.line_item_id = 268515;
1143
1157
  response.body.seatbid[0].bid[0].ext.improvedigital.buying_type = 'deal_id';
1144
- bids = spec.interpretResponse(response, {bidderRequest});
1158
+ bids = spec.interpretResponse(response, request);
1145
1159
  expect(bids[0].dealId).to.equal(268515);
1146
1160
  });
1147
1161
 
1148
1162
  it('should set currency', function () {
1149
1163
  const response = deepClone(serverResponse);
1150
- response.body.cur = 'eur';
1151
- const bids = spec.interpretResponse(response, {bidderRequest});
1164
+ response.body.cur = 'EUR';
1165
+ const bids = spec.interpretResponse(response, makeRequest(bidderRequest));
1152
1166
  expect(bids[0].currency).to.equal('EUR');
1153
1167
  });
1154
1168
 
1155
1169
  it('should return empty array for bad response or no price', function () {
1170
+ const request = makeRequest(bidderRequest);
1156
1171
  let response = deepClone(serverResponse);
1157
1172
  let bids;
1158
1173
 
1159
1174
  // Price missing or 0
1160
1175
  response.body.seatbid[0].bid[0].price = 0;
1161
- bids = spec.interpretResponse(response, {bidderRequest});
1176
+ bids = spec.interpretResponse(response, request);
1162
1177
  expect(bids).to.deep.equal([]);
1163
1178
  delete response.body.seatbid[0].bid[0];
1164
- bids = spec.interpretResponse(response, {bidderRequest});
1179
+ bids = spec.interpretResponse(response, request);
1165
1180
  expect(bids).to.deep.equal([]);
1166
1181
  response.body.seatbid[0].bid[0] = [];
1167
- bids = spec.interpretResponse(response, {bidderRequest});
1182
+ bids = spec.interpretResponse(response, request);
1168
1183
  expect(bids).to.deep.equal([]);
1169
1184
 
1170
1185
  // errorCode present
1171
1186
  response = deepClone(serverResponse);
1172
1187
  response.body.seatbid[0].bid[0].errorCode = undefined;
1173
- bids = spec.interpretResponse(response, {bidderRequest});
1188
+ bids = spec.interpretResponse(response, request);
1174
1189
  expect(bids).to.deep.equal([]);
1175
1190
 
1176
1191
  // adm and native missing
1177
1192
  response = deepClone(serverResponse);
1178
1193
  delete response.body.seatbid[0].bid[0].adm;
1179
- bids = spec.interpretResponse(response, {bidderRequest});
1194
+ bids = spec.interpretResponse(response, request);
1180
1195
  expect(bids).to.deep.equal([]);
1181
1196
  response.body.seatbid[0].bid[0].adm = null;
1182
- bids = spec.interpretResponse(response, {bidderRequest});
1197
+ bids = spec.interpretResponse(response, request);
1183
1198
  expect(bids).to.deep.equal([]);
1184
1199
  });
1185
1200
 
1186
1201
  it('should set netRevenue', function () {
1187
1202
  const response = deepClone(serverResponse);
1188
1203
  response.body.seatbid[0].bid[0].ext.improvedigital.is_net = true;
1189
- const bids = spec.interpretResponse(response, {bidderRequest});
1204
+ const bids = spec.interpretResponse(response, makeRequest(bidderRequest));
1190
1205
  expect(bids[0].netRevenue).to.equal(true);
1191
1206
  });
1192
1207
 
@@ -1194,59 +1209,53 @@ describe('Improve Digital Adapter Tests', function () {
1194
1209
  const adomain = ['domain.com'];
1195
1210
  const response = deepClone(serverResponse);
1196
1211
  response.body.seatbid[0].bid[0].adomain = adomain;
1197
- const bids = spec.interpretResponse(response, {bidderRequest});
1212
+ const bids = spec.interpretResponse(response, makeRequest(bidderRequest));
1198
1213
  expect(bids[0].meta.advertiserDomains).to.equal(adomain);
1199
1214
  });
1200
1215
  //
1201
1216
  // Native ads
1202
- it('should return a well-formed native ad bid', function () {
1203
- const bids = spec.interpretResponse(serverResponseNative, {bidderRequest: nativeBidderRequest});
1204
- // Verify Native Response
1205
- expect(bids[0].native).to.exist;
1206
- const nativeBid = bids[0].native;
1207
- const nativeResp = JSON.parse(serverResponseNative.body.seatbid[0].bid[0].adm);
1208
- // Verify Native Response
1209
- expect(nativeBid.clickUrl).to.exist.and.equal(nativeResp.link.url);
1210
- expect(nativeBid.impressionTrackers).to.exist.and.deep.equal(nativeResp.imptrackers);
1211
- expect(nativeBid.javascriptTrackers).to.exist.and.deep.equal(nativeResp.jstracker);
1212
-
1213
- // Verify Assets
1214
- expect(nativeBid.title).to.exist.and.equal('Sample Prebid Test Title');
1215
- expect(nativeBid.sponsoredBy).to.exist.and.equal('ImproveDigital');
1216
- expect(nativeBid.body).to.exist.and.equal('Test content.');
1217
- });
1217
+ if (FEATURES.NATIVE) {
1218
+ it('should return a well-formed native ad bid', function () {
1219
+ const reqBids = updateNativeParams(nativeBidderRequest.bids);
1220
+ const request = makeRequest({
1221
+ ...nativeBidderRequest,
1222
+ reqBids
1223
+ })
1224
+ const bids = spec.interpretResponse(serverResponseNative, request);
1225
+ expect(bids[0].native.ortb).to.eql(JSON.parse(serverResponseNative.body.seatbid[0].bid[0].adm))
1226
+ });
1218
1227
 
1219
- it('should return a well-formed native bid for multi-format ad unit', function () {
1220
- const bids = spec.interpretResponse(serverResponseNative, {bidderRequest: multiFormatBidderRequest});
1221
- expect(bids[0].mediaType).to.equal(NATIVE);
1222
- });
1228
+ it('should return a well-formed native bid for multi-format ad unit', function () {
1229
+ const bids = spec.interpretResponse(serverResponseNative, makeRequest(multiFormatBidderRequest));
1230
+ expect(bids[0].mediaType).to.equal(NATIVE);
1231
+ });
1232
+ }
1223
1233
 
1224
1234
  // Video
1225
1235
  it('should return a well-formed instream video bid', function () {
1226
- const bids = spec.interpretResponse(serverResponseVideo, {bidderRequest: instreamBidderRequest});
1227
- expect(bids).to.deep.equal(expectedBidInstreamVideo);
1236
+ const bids = spec.interpretResponse(serverResponseVideo, makeRequest(instreamBidderRequest));
1237
+ expectMatch(bids, expectedBidInstreamVideo);
1228
1238
  });
1229
1239
 
1230
1240
  it('should return a well-formed outstream video bid', function () {
1231
- const bids = spec.interpretResponse(serverResponseVideo, {bidderRequest: outstreamBidderRequest});
1241
+ const bids = spec.interpretResponse(serverResponseVideo, makeRequest(outstreamBidderRequest));
1232
1242
  expect(bids[0].renderer).to.exist;
1233
- delete (bids[0].renderer);
1234
- expect(bids).to.deep.equal(expectedBidOutstreamVideo);
1243
+ expectMatch(bids, expectedBidOutstreamVideo);
1235
1244
  });
1236
1245
 
1237
1246
  it('should return a well-formed outstream video bid for multi-format ad unit', function () {
1247
+ const request = makeRequest(multiFormatBidderRequest);
1238
1248
  const videoResponse = deepClone(serverResponseVideo);
1239
- let bids = spec.interpretResponse(videoResponse, {bidderRequest: multiFormatBidderRequest});
1249
+ let bids = spec.interpretResponse(videoResponse, request);
1240
1250
  expect(bids[0].renderer).to.exist;
1241
- delete (bids[0].renderer);
1242
- expect(bids).to.deep.equal(expectedBidOutstreamVideo);
1251
+ expectMatch(bids, expectedBidOutstreamVideo);
1243
1252
 
1244
1253
  videoResponse.body.seatbid[0].bid[0].adm = '<vAst';
1245
- bids = spec.interpretResponse(videoResponse, {bidderRequest: multiFormatBidderRequest});
1254
+ bids = spec.interpretResponse(videoResponse, request);
1246
1255
  expect(bids[0].mediaType).to.equal(VIDEO);
1247
1256
 
1248
1257
  videoResponse.body.seatbid[0].bid[0].adm = '<?xml';
1249
- bids = spec.interpretResponse(videoResponse, {bidderRequest: multiFormatBidderRequest});
1258
+ bids = spec.interpretResponse(videoResponse, request);
1250
1259
  expect(bids[0].mediaType).to.equal(VIDEO);
1251
1260
  });
1252
1261
  });
@@ -1347,5 +1356,16 @@ describe('Improve Digital Adapter Tests', function () {
1347
1356
  const syncs = spec.getUserSyncs({ iframeEnabled: true, pixelEnabled: true }, serverResponses);
1348
1357
  expect(syncs).to.deep.equal([{ type: 'iframe', url: basicIframeSyncUrl + '&pbs=1' }]);
1349
1358
  });
1359
+
1360
+ it('should add bidders to iframe user sync url', function () {
1361
+ getConfigStub = sinon.stub(config, 'getConfig');
1362
+ getConfigStub.withArgs('improvedigital.extend').returns(true);
1363
+ spec.buildRequests([simpleBidRequest], {});
1364
+ const rawResponse = deepClone(serverResponse)
1365
+ deepSetValue(rawResponse, 'body.ext.responsetimemillis', {a: 1, b: 1, c: 1, d: 1, e: 1})
1366
+ let syncs = spec.getUserSyncs({ iframeEnabled: true, pixelEnabled: true }, [rawResponse]);
1367
+ let url = basicIframeSyncUrl + '&pbs=1' + '&bidders=a,b,c,d,e'
1368
+ expect(syncs).to.deep.equal([{ type: 'iframe', url }]);
1369
+ });
1350
1370
  });
1351
1371
  });