prebid.js 6.0.0 → 6.4.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 (201) hide show
  1. package/.babelrc.js +1 -7
  2. package/.circleci/config.yml +1 -1
  3. package/README.md +1 -1
  4. package/browsers.json +13 -29
  5. package/gulpfile.js +88 -82
  6. package/integrationExamples/gpt/weboramaRtdProvider_example.html +23 -14
  7. package/karma.conf.maker.js +2 -2
  8. package/modules/33acrossBidAdapter.js +189 -102
  9. package/modules/adagioBidAdapter.js +1 -1
  10. package/modules/addefendBidAdapter.js +1 -0
  11. package/modules/adheseBidAdapter.js +7 -2
  12. package/modules/adkernelBidAdapter.js +147 -61
  13. package/modules/adlivetechBidAdapter.md +61 -0
  14. package/modules/adlooxAdServerVideo.js +2 -2
  15. package/modules/adlooxAnalyticsAdapter.js +4 -4
  16. package/modules/admanBidAdapter.js +1 -0
  17. package/modules/admixerBidAdapter.js +3 -2
  18. package/modules/adnuntiusBidAdapter.js +5 -2
  19. package/modules/adomikAnalyticsAdapter.js +16 -4
  20. package/modules/adplusBidAdapter.js +203 -0
  21. package/modules/adplusBidAdapter.md +39 -0
  22. package/modules/adxcgBidAdapter.js +311 -359
  23. package/modules/adxcgBidAdapter.md +22 -21
  24. package/modules/adyoulikeBidAdapter.js +7 -2
  25. package/modules/aniviewBidAdapter.js +1 -1
  26. package/modules/appnexusBidAdapter.js +23 -3
  27. package/modules/beachfrontBidAdapter.js +14 -17
  28. package/modules/beopBidAdapter.js +6 -4
  29. package/modules/bidViewability.js +3 -3
  30. package/modules/bidViewabilityIO.js +3 -3
  31. package/modules/codefuelBidAdapter.js +1 -3
  32. package/modules/codefuelBidAdapter.md +3 -3
  33. package/modules/colossussspBidAdapter.js +7 -0
  34. package/modules/compassBidAdapter.js +201 -0
  35. package/modules/compassBidAdapter.md +79 -0
  36. package/modules/craftBidAdapter.js +5 -3
  37. package/modules/criteoBidAdapter.js +1 -1
  38. package/modules/currency.js +2 -2
  39. package/modules/cwireBidAdapter.js +3 -0
  40. package/modules/dailyhuntBidAdapter.js +435 -0
  41. package/modules/dailyhuntBidAdapter.md +4 -0
  42. package/modules/datablocksBidAdapter.js +3 -3
  43. package/modules/dchain.js +149 -0
  44. package/modules/dchain.md +45 -0
  45. package/modules/deepintentBidAdapter.js +1 -1
  46. package/modules/dspxBidAdapter.js +1 -1
  47. package/modules/emx_digitalBidAdapter.js +9 -1
  48. package/modules/engageyaBidAdapter.js +68 -54
  49. package/modules/feedadBidAdapter.js +2 -2
  50. package/modules/feedadBidAdapter.md +4 -2
  51. package/modules/freewheel-sspBidAdapter.js +6 -0
  52. package/modules/futureads.md +48 -0
  53. package/modules/glimpseBidAdapter.js +44 -16
  54. package/modules/goldbachBidAdapter.js +1176 -0
  55. package/modules/goldbachBidAdapter.md +151 -0
  56. package/modules/gptPreAuction.js +11 -5
  57. package/modules/gridBidAdapter.js +5 -4
  58. package/modules/gumgumBidAdapter.js +7 -3
  59. package/modules/id5IdSystem.md +6 -6
  60. package/modules/imRtdProvider.js +31 -0
  61. package/modules/improvedigitalBidAdapter.js +19 -3
  62. package/modules/instreamTracking.js +4 -4
  63. package/modules/intersectionRtdProvider.js +114 -0
  64. package/modules/invibesBidAdapter.js +64 -14
  65. package/modules/invibesBidAdapter.md +2 -1
  66. package/modules/ipromBidAdapter.js +79 -0
  67. package/modules/ixBidAdapter.js +185 -22
  68. package/modules/kinessoIdSystem.js +1 -1
  69. package/modules/limelightDigitalBidAdapter.js +2 -1
  70. package/modules/livewrappedBidAdapter.js +8 -2
  71. package/modules/lotamePanoramaIdSystem.js +80 -8
  72. package/modules/luponmediaBidAdapter.js +570 -0
  73. package/modules/mediasquareBidAdapter.js +1 -9
  74. package/modules/merkleIdSystem.js +5 -0
  75. package/modules/missenaBidAdapter.js +89 -0
  76. package/modules/nativoBidAdapter.js +27 -1
  77. package/modules/nextMillenniumBidAdapter.js +37 -7
  78. package/modules/oguryBidAdapter.js +2 -1
  79. package/modules/openxBidAdapter.js +6 -1
  80. package/modules/prebidServerBidAdapter/index.js +19 -15
  81. package/modules/pubgeniusBidAdapter.js +1 -1
  82. package/modules/pubmaticBidAdapter.js +5 -3
  83. package/modules/pubxaiAnalyticsAdapter.js +17 -0
  84. package/modules/relaidoBidAdapter.js +86 -65
  85. package/modules/richaudienceBidAdapter.js +2 -3
  86. package/modules/rtdModule/index.js +48 -18
  87. package/modules/rubiconBidAdapter.js +31 -19
  88. package/modules/saambaaBidAdapter.js +420 -0
  89. package/modules/saambaaBidAdapter.md +65 -68
  90. package/modules/seedtagBidAdapter.js +6 -0
  91. package/modules/sharedIdSystem.js +27 -1
  92. package/modules/smaatoBidAdapter.js +9 -1
  93. package/modules/smartxBidAdapter.js +17 -1
  94. package/modules/sspBCBidAdapter.js +34 -3
  95. package/modules/tappxBidAdapter.js +3 -1
  96. package/modules/targetVideoBidAdapter.js +187 -0
  97. package/modules/targetVideoBidAdapter.md +34 -0
  98. package/modules/telariaBidAdapter.js +2 -2
  99. package/modules/trustxBidAdapter.js +18 -17
  100. package/modules/undertoneBidAdapter.js +8 -1
  101. package/modules/userId/index.js +27 -2
  102. package/modules/ventes.md +71 -0
  103. package/modules/ventesBidAdapter.js +104 -64
  104. package/modules/ventesBidAdapter.md +0 -1
  105. package/modules/vidoomyBidAdapter.js +65 -108
  106. package/modules/visxBidAdapter.js +20 -3
  107. package/modules/visxBidAdapter.md +4 -6
  108. package/modules/weboramaRtdProvider.js +288 -73
  109. package/modules/weboramaRtdProvider.md +27 -10
  110. package/modules/yahoosspBidAdapter.js +5 -1
  111. package/modules/yahoosspBidAdapter.md +1 -1
  112. package/modules/yieldlabBidAdapter.js +41 -10
  113. package/modules/yieldlabBidAdapter.md +91 -48
  114. package/modules/yieldoneBidAdapter.js +115 -11
  115. package/modules/zetaSspBidAdapter.md +33 -1
  116. package/modules/zeta_global_sspBidAdapter.js +22 -1
  117. package/package.json +6 -1
  118. package/plugins/pbjsGlobals.js +28 -1
  119. package/src/adapterManager.js +14 -8
  120. package/src/auction.js +5 -4
  121. package/src/prebid.js +1 -2
  122. package/src/targeting.js +24 -3
  123. package/src/utils.js +41 -7
  124. package/test/helpers/prebidGlobal.js +1 -0
  125. package/test/spec/integration/faker/googletag.js +6 -0
  126. package/test/spec/modules/33acrossBidAdapter_spec.js +300 -78
  127. package/test/spec/modules/adheseBidAdapter_spec.js +27 -1
  128. package/test/spec/modules/adlooxAnalyticsAdapter_spec.js +6 -6
  129. package/test/spec/modules/adnuntiusBidAdapter_spec.js +35 -0
  130. package/test/spec/modules/adomikAnalyticsAdapter_spec.js +9 -1
  131. package/test/spec/modules/adplusBidAdapter_spec.js +213 -0
  132. package/test/spec/modules/adxcgBidAdapter_spec.js +820 -571
  133. package/test/spec/modules/adyoulikeBidAdapter_spec.js +26 -0
  134. package/test/spec/modules/appnexusBidAdapter_spec.js +63 -1
  135. package/test/spec/modules/beachfrontBidAdapter_spec.js +65 -1
  136. package/test/spec/modules/beopBidAdapter_spec.js +1 -1
  137. package/test/spec/modules/bidViewabilityIO_spec.js +2 -2
  138. package/test/spec/modules/bidViewability_spec.js +4 -4
  139. package/test/spec/modules/codefuelBidAdapter_spec.js +1 -1
  140. package/test/spec/modules/colossussspBidAdapter_spec.js +9 -0
  141. package/test/spec/modules/compassBidAdapter_spec.js +397 -0
  142. package/test/spec/modules/cwireBidAdapter_spec.js +10 -8
  143. package/test/spec/modules/dailyhuntBidAdapter_spec.js +404 -0
  144. package/test/spec/modules/datablocksBidAdapter_spec.js +3 -3
  145. package/test/spec/modules/dchain_spec.js +329 -0
  146. package/test/spec/modules/emx_digitalBidAdapter_spec.js +10 -0
  147. package/test/spec/modules/engageyaBidAdapter_spec.js +231 -95
  148. package/test/spec/modules/eplanningBidAdapter_spec.js +8 -8
  149. package/test/spec/modules/feedadBidAdapter_spec.js +15 -0
  150. package/test/spec/modules/freewheel-sspBidAdapter_spec.js +19 -0
  151. package/test/spec/modules/glimpseBidAdapter_spec.js +33 -0
  152. package/test/spec/modules/goldbachBidAdapter_spec.js +1359 -0
  153. package/test/spec/modules/gptPreAuction_spec.js +58 -4
  154. package/test/spec/modules/gumgumBidAdapter_spec.js +6 -0
  155. package/test/spec/modules/imRtdProvider_spec.js +25 -0
  156. package/test/spec/modules/improvedigitalBidAdapter_spec.js +3 -1
  157. package/test/spec/modules/intersectionRtdProvider_spec.js +141 -0
  158. package/test/spec/modules/invibesBidAdapter_spec.js +148 -4
  159. package/test/spec/modules/ipromBidAdapter_spec.js +195 -0
  160. package/test/spec/modules/ixBidAdapter_spec.js +293 -2
  161. package/test/spec/modules/konduitWrapper_spec.js +0 -1
  162. package/test/spec/modules/limelightDigitalBidAdapter_spec.js +10 -7
  163. package/test/spec/modules/livewrappedBidAdapter_spec.js +31 -0
  164. package/test/spec/modules/lotamePanoramaIdSystem_spec.js +227 -0
  165. package/test/spec/modules/luponmediaBidAdapter_spec.js +412 -0
  166. package/test/spec/modules/mediasquareBidAdapter_spec.js +4 -4
  167. package/test/spec/modules/merkleIdSystem_spec.js +18 -0
  168. package/test/spec/modules/missenaBidAdapter_spec.js +134 -0
  169. package/test/spec/modules/nativoBidAdapter_spec.js +35 -18
  170. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +26 -1
  171. package/test/spec/modules/oguryBidAdapter_spec.js +13 -11
  172. package/test/spec/modules/openxBidAdapter_spec.js +5 -0
  173. package/test/spec/modules/prebidServerBidAdapter_spec.js +62 -2
  174. package/test/spec/modules/pubgeniusBidAdapter_spec.js +3 -3
  175. package/test/spec/modules/pubmaticBidAdapter_spec.js +1 -1
  176. package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +11 -0
  177. package/test/spec/modules/realTimeDataModule_spec.js +135 -49
  178. package/test/spec/modules/relaidoBidAdapter_spec.js +71 -63
  179. package/test/spec/modules/richaudienceBidAdapter_spec.js +2 -2
  180. package/test/spec/modules/rubiconBidAdapter_spec.js +65 -9
  181. package/test/spec/modules/seedtagBidAdapter_spec.js +3 -0
  182. package/test/spec/modules/sharedIdSystem_spec.js +52 -6
  183. package/test/spec/modules/smaatoBidAdapter_spec.js +61 -0
  184. package/test/spec/modules/smartxBidAdapter_spec.js +9 -0
  185. package/test/spec/modules/sspBCBidAdapter_spec.js +33 -3
  186. package/test/spec/modules/tappxBidAdapter_spec.js +4 -0
  187. package/test/spec/modules/targetVideoBidAdapter_spec.js +96 -0
  188. package/test/spec/modules/trustxBidAdapter_spec.js +42 -0
  189. package/test/spec/modules/userId_spec.js +51 -0
  190. package/test/spec/modules/vidoomyBidAdapter_spec.js +32 -13
  191. package/test/spec/modules/visxBidAdapter_spec.js +121 -5
  192. package/test/spec/modules/weboramaRtdProvider_spec.js +408 -214
  193. package/test/spec/modules/yahoosspBidAdapter_spec.js +28 -1
  194. package/test/spec/modules/yieldlabBidAdapter_spec.js +81 -0
  195. package/test/spec/modules/yieldoneBidAdapter_spec.js +299 -53
  196. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +33 -1
  197. package/test/spec/unit/core/adapterManager_spec.js +24 -6
  198. package/test/spec/unit/core/targeting_spec.js +116 -0
  199. package/test/spec/utils_spec.js +38 -0
  200. package/test/test_deps.js +3 -0
  201. package/test/test_index.js +1 -3
@@ -36,11 +36,6 @@ const BidderRequestBuilder = function BidderRequestBuilder(options) {
36
36
  bidderRequestId: BID_DEFAULTS.request.bidderRequestId,
37
37
  transactionId: BID_DEFAULTS.request.transactionId,
38
38
  timeout: 3000,
39
- refererInfo: {
40
- numIframes: 0,
41
- reachedTop: true,
42
- referer: 'http://test.io/index.html?pbjs_debug=true'
43
- }
44
39
  };
45
40
 
46
41
  const request = {
@@ -82,16 +77,13 @@ const BidRequestBuilder = function BidRequestBuilder(options, deleteKeys) {
82
77
  };
83
78
 
84
79
  describe('C-WIRE bid adapter', () => {
85
- let utilsMock;
86
80
  let sandbox;
87
81
 
88
82
  beforeEach(() => {
89
- utilsMock = sinon.mock(utils);
90
83
  sandbox = sinon.createSandbox();
91
84
  });
92
85
 
93
86
  afterEach(() => {
94
- utilsMock.restore();
95
87
  sandbox.restore();
96
88
  });
97
89
 
@@ -146,6 +138,12 @@ describe('C-WIRE bid adapter', () => {
146
138
 
147
139
  describe('C-WIRE - buildRequests()', function () {
148
140
  it('creates a valid request', function () {
141
+ // for whatever reason stub for getWindowLocation does not work
142
+ // so this was the closest way to test for get params
143
+ const params = sandbox.stub(utils, 'getParameterByName');
144
+ params.withArgs('cwgroups').returns('group_1');
145
+ params.withArgs('cwcreative').returns('54321');
146
+
149
147
  const bid01 = new BidRequestBuilder({
150
148
  mediaTypes: {
151
149
  banner: {
@@ -153,12 +151,16 @@ describe('C-WIRE bid adapter', () => {
153
151
  }
154
152
  }
155
153
  }).withParams().build();
154
+
156
155
  const bidderRequest01 = new BidderRequestBuilder().build();
157
156
 
158
157
  const requests = spec.buildRequests([bid01], bidderRequest01);
158
+
159
159
  expect(requests.data.slots.length).to.equal(1);
160
160
  expect(requests.data.cwid).to.be.null;
161
161
  expect(requests.data.slots[0].sizes[0]).to.equal('1x1');
162
+ expect(requests.data.cwcreative).to.equal('54321');
163
+ expect(requests.data.refgroups[0]).to.equal('group_1');
162
164
  });
163
165
  });
164
166
 
@@ -0,0 +1,404 @@
1
+ import { expect } from 'chai';
2
+ import { spec } from 'modules/dailyhuntBidAdapter.js';
3
+
4
+ const PROD_PREBID_ENDPOINT_URL = 'https://pbs.dailyhunt.in/openrtb2/auction?partner=dailyhunt';
5
+ const PROD_PREBID_TEST_ENDPOINT_URL = 'https://qa-pbs-van.dailyhunt.in/openrtb2/auction?partner=dailyhunt';
6
+
7
+ const _encodeURIComponent = function (a) {
8
+ if (!a) { return }
9
+ let b = window.encodeURIComponent(a);
10
+ b = b.replace(/'/g, '%27');
11
+ return b;
12
+ }
13
+
14
+ describe('DailyhuntAdapter', function () {
15
+ describe('isBidRequestValid', function () {
16
+ let bid = {
17
+ 'bidder': 'dailyhunt',
18
+ 'params': {
19
+ placement_id: 1,
20
+ publisher_id: 1,
21
+ partner_name: 'dailyhunt'
22
+ }
23
+ };
24
+
25
+ it('should return true when required params found', function () {
26
+ expect(spec.isBidRequestValid(bid)).to.equal(true);
27
+ });
28
+
29
+ it('should return false when required params are not passed', function () {
30
+ let bid = Object.assign({}, bid);
31
+ delete bid.params;
32
+ bid.params = {};
33
+ expect(spec.isBidRequestValid(bid)).to.equal(false);
34
+ });
35
+ });
36
+ describe('buildRequests', function() {
37
+ let bidRequests = [
38
+ {
39
+ bidder: 'dailyhunt',
40
+ params: {
41
+ placement_id: 1,
42
+ publisher_id: 1,
43
+ partner_name: 'dailyhunt',
44
+ bidfloor: 0.1,
45
+ device: {
46
+ ip: '47.9.247.217'
47
+ },
48
+ site: {
49
+ cat: ['1', '2', '3']
50
+ }
51
+ },
52
+ mediaTypes: {
53
+ banner: {
54
+ sizes: [[300, 250]]
55
+ }
56
+ },
57
+ adUnitCode: 'adunit-code',
58
+ sizes: [[300, 50]],
59
+ bidId: '30b31c1838de1e',
60
+ bidderRequestId: '22edbae2733bf6',
61
+ auctionId: '1d1a030790a475',
62
+ transactionId: '04f2659e-c005-4eb1-a57c-fa93145e3843'
63
+ }
64
+ ];
65
+ let nativeBidRequests = [
66
+ {
67
+ bidder: 'dailyhunt',
68
+ params: {
69
+ placement_id: 1,
70
+ publisher_id: 1,
71
+ partner_name: 'dailyhunt',
72
+ },
73
+ nativeParams: {
74
+ title: {
75
+ required: true,
76
+ len: 80
77
+ },
78
+ image: {
79
+ required: true,
80
+ sizes: [150, 50]
81
+ },
82
+ },
83
+ mediaTypes: {
84
+ native: {
85
+ title: {
86
+ required: true
87
+ },
88
+ }
89
+ },
90
+ adUnitCode: 'adunit-code',
91
+ sizes: [[300, 250], [300, 50]],
92
+ bidId: '30b31c1838de1e',
93
+ bidderRequestId: '22edbae2733bf6',
94
+ auctionId: '1d1a030790a475',
95
+ transactionId: '04f2659e-c005-4eb1-a57c-fa93145e3843'
96
+ }
97
+ ];
98
+ let videoBidRequests = [
99
+ {
100
+ bidder: 'dailyhunt',
101
+ params: {
102
+ placement_id: 1,
103
+ publisher_id: 1,
104
+ partner_name: 'dailyhunt'
105
+ },
106
+ nativeParams: {
107
+ video: {
108
+ context: 'instream'
109
+ }
110
+ },
111
+ mediaTypes: {
112
+ video: {
113
+ context: 'instream'
114
+ }
115
+ },
116
+ adUnitCode: 'adunit-code',
117
+ sizes: [[300, 250], [300, 50]],
118
+ bidId: '30b31c1838de1e',
119
+ bidderRequestId: '22edbae2733bf6',
120
+ auctionId: '1d1a030790a475',
121
+ transactionId: '04f2659e-c005-4eb1-a57c-fa93145e3843'
122
+ }
123
+ ];
124
+ let bidderRequest = {
125
+ 'bidderRequestId': '22edbae2733bf6',
126
+ 'auctionId': '1d1a030790a475',
127
+ 'bidderCode': 'dailyhunt',
128
+ 'bids': [
129
+ {
130
+ ...bidRequests[0]
131
+ }
132
+ ],
133
+ 'refererInfo': {
134
+ 'referer': 'http://m.dailyhunt.in/'
135
+ }
136
+ };
137
+ let nativeBidderRequest = {
138
+ 'bidderRequestId': '22edbae2733bf6',
139
+ 'auctionId': '1d1a030790a475',
140
+ 'bidderCode': 'dailyhunt',
141
+ 'bids': [
142
+ {
143
+ ...nativeBidRequests[0]
144
+ }
145
+ ],
146
+ 'refererInfo': {
147
+ 'referer': 'http://m.dailyhunt.in/'
148
+ }
149
+ };
150
+ let videoBidderRequest = {
151
+ 'bidderRequestId': '22edbae2733bf6',
152
+ 'auctionId': '1d1a030790a475',
153
+ 'bidderCode': 'dailyhunt',
154
+ 'bids': [
155
+ {
156
+ ...videoBidRequests[0]
157
+ }
158
+ ],
159
+ 'refererInfo': {
160
+ 'referer': 'http://m.dailyhunt.in/'
161
+ }
162
+ };
163
+
164
+ it('sends display bid request to ENDPOINT via POST', function () {
165
+ const request = spec.buildRequests(bidRequests, bidderRequest)[0];
166
+ expect(request.url).to.equal(PROD_PREBID_ENDPOINT_URL);
167
+ expect(request.method).to.equal('POST');
168
+ });
169
+
170
+ it('sends native bid request to ENDPOINT via POST', function () {
171
+ const request = spec.buildRequests(nativeBidRequests, nativeBidderRequest)[0];
172
+ expect(request.url).to.equal(PROD_PREBID_ENDPOINT_URL);
173
+ expect(request.method).to.equal('POST');
174
+ });
175
+
176
+ it('sends video bid request to ENDPOINT via POST', function () {
177
+ const request = spec.buildRequests(videoBidRequests, videoBidderRequest)[0];
178
+ expect(request.url).to.equal(PROD_PREBID_ENDPOINT_URL);
179
+ expect(request.method).to.equal('POST');
180
+ });
181
+ });
182
+ describe('interpretResponse', function () {
183
+ let bidResponses = {
184
+ id: 'da32def7-6779-403c-ada7-0b201dbc9744',
185
+ seatbid: [
186
+ {
187
+ bid: [
188
+ {
189
+ id: 'id1',
190
+ impid: 'banner-impid',
191
+ price: 1.4,
192
+ adm: 'adm',
193
+ adid: '66658',
194
+ crid: 'asd5ddbf014cac993.66466212',
195
+ dealid: 'asd5ddbf014cac993.66466212',
196
+ w: 300,
197
+ h: 250,
198
+ nurl: 'winUrl',
199
+ ext: {
200
+ prebid: {
201
+ type: 'banner'
202
+ }
203
+ }
204
+ },
205
+ {
206
+ id: '5caccc1f-94a6-4230-a1f9-6186ee65da99',
207
+ impid: 'video-impid',
208
+ price: 1.4,
209
+ nurl: 'winUrl',
210
+ adm: 'adm',
211
+ adid: '980',
212
+ crid: '2394',
213
+ w: 300,
214
+ h: 250,
215
+ ext: {
216
+ prebid: {
217
+ 'type': 'video'
218
+ },
219
+ bidder: {
220
+ cacheKey: 'cache_key',
221
+ vastUrl: 'vastUrl'
222
+ }
223
+ }
224
+ },
225
+ {
226
+ id: '74973faf-cce7-4eff-abd0-b59b8e91ca87',
227
+ impid: 'native-impid',
228
+ price: 50,
229
+ nurl: 'winUrl',
230
+ adm: '{"native":{"link":{"url":"url","clicktrackers":[]},"assets":[{"id":1,"required":1,"img":{},"video":{},"data":{},"title":{"text":"TITLE"},"link":{}},{"id":1,"required":1,"img":{},"video":{},"data":{"type":2,"value":"Lorem Ipsum Lorem Ipsum Lorem Ipsum."},"title":{},"link":{}},{"id":1,"required":1,"img":{},"video":{},"data":{"type":12,"value":"Install Here"},"title":{},"link":{}},{"id":1,"required":1,"img":{"type":3,"url":"urk","w":990,"h":505},"video":{},"data":{},"title":{},"link":{}}],"imptrackers":[]}}',
231
+ adid: '968',
232
+ crid: '2370',
233
+ w: 300,
234
+ h: 250,
235
+ ext: {
236
+ prebid: {
237
+ type: 'native'
238
+ },
239
+ bidder: null
240
+ }
241
+ },
242
+ {
243
+ id: '5caccc1f-94a6-4230-a1f9-6186ee65da99',
244
+ impid: 'video-outstream-impid',
245
+ price: 1.4,
246
+ nurl: 'winUrl',
247
+ adm: 'adm',
248
+ adid: '980',
249
+ crid: '2394',
250
+ w: 300,
251
+ h: 250,
252
+ ext: {
253
+ prebid: {
254
+ 'type': 'video'
255
+ },
256
+ bidder: {
257
+ cacheKey: 'cache_key',
258
+ vastUrl: 'vastUrl'
259
+ }
260
+ }
261
+ },
262
+ ],
263
+ seat: 'dailyhunt'
264
+ }
265
+ ],
266
+ ext: {
267
+ responsetimemillis: {
268
+ dailyhunt: 119
269
+ }
270
+ }
271
+ };
272
+
273
+ it('should get correct bid response', function () {
274
+ let expectedResponse = [
275
+ {
276
+ requestId: '1',
277
+ cpm: 1.4,
278
+ creativeId: 'asd5ddbf014cac993.66466212',
279
+ width: 300,
280
+ height: 250,
281
+ ttl: 360,
282
+ netRevenue: true,
283
+ currency: 'USD',
284
+ ad: 'adm',
285
+ mediaType: 'banner',
286
+ winUrl: 'winUrl',
287
+ adomain: 'dailyhunt'
288
+ },
289
+ {
290
+ requestId: '2',
291
+ cpm: 1.4,
292
+ creativeId: '2394',
293
+ width: 300,
294
+ height: 250,
295
+ ttl: 360,
296
+ netRevenue: true,
297
+ currency: 'USD',
298
+ mediaType: 'video',
299
+ winUrl: 'winUrl',
300
+ adomain: 'dailyhunt',
301
+ videoCacheKey: 'cache_key',
302
+ vastUrl: 'vastUrl',
303
+ },
304
+ {
305
+ requestId: '3',
306
+ cpm: 1.4,
307
+ creativeId: '2370',
308
+ width: 300,
309
+ height: 250,
310
+ ttl: 360,
311
+ netRevenue: true,
312
+ currency: 'USD',
313
+ mediaType: 'native',
314
+ winUrl: 'winUrl',
315
+ adomain: 'dailyhunt',
316
+ native: {
317
+ clickUrl: 'https%3A%2F%2Fmontu1996.github.io%2F',
318
+ clickTrackers: [],
319
+ impressionTrackers: [],
320
+ javascriptTrackers: [],
321
+ title: 'TITLE',
322
+ body: 'Lorem Ipsum Lorem Ipsum Lorem Ipsum.',
323
+ cta: 'Install Here',
324
+ image: {
325
+ url: 'url',
326
+ height: 505,
327
+ width: 990
328
+ }
329
+ }
330
+ },
331
+ {
332
+ requestId: '4',
333
+ cpm: 1.4,
334
+ creativeId: '2394',
335
+ width: 300,
336
+ height: 250,
337
+ ttl: 360,
338
+ netRevenue: true,
339
+ currency: 'USD',
340
+ mediaType: 'video',
341
+ winUrl: 'winUrl',
342
+ adomain: 'dailyhunt',
343
+ vastXml: 'adm',
344
+ },
345
+ ];
346
+ let bidderRequest = {
347
+ bids: [
348
+ {
349
+ bidId: 'banner-impid',
350
+ adUnitCode: 'code1',
351
+ requestId: '1'
352
+ },
353
+ {
354
+ bidId: 'video-impid',
355
+ adUnitCode: 'code2',
356
+ requestId: '2',
357
+ mediaTypes: {
358
+ video: {
359
+ context: 'instream'
360
+ }
361
+ }
362
+ },
363
+ {
364
+ bidId: 'native-impid',
365
+ adUnitCode: 'code3',
366
+ requestId: '3'
367
+ },
368
+ {
369
+ bidId: 'video-outstream-impid',
370
+ adUnitCode: 'code4',
371
+ requestId: '4',
372
+ mediaTypes: {
373
+ video: {
374
+ context: 'outstream'
375
+ }
376
+ }
377
+ },
378
+ ]
379
+ }
380
+ let result = spec.interpretResponse({ body: bidResponses }, bidderRequest);
381
+ result.forEach((r, i) => {
382
+ expect(Object.keys(r)).to.have.members(Object.keys(expectedResponse[i]));
383
+ });
384
+ });
385
+ })
386
+ describe('onBidWon', function () {
387
+ it('should hit win url when bid won', function () {
388
+ let bid = {
389
+ requestId: '1',
390
+ cpm: 1.4,
391
+ creativeId: 'asd5ddbf014cac993.66466212',
392
+ width: 300,
393
+ height: 250,
394
+ ttl: 360,
395
+ netRevenue: true,
396
+ currency: 'USD',
397
+ ad: 'adm',
398
+ mediaType: 'banner',
399
+ winUrl: 'winUrl'
400
+ };
401
+ expect(spec.onBidWon(bid)).to.equal(undefined);
402
+ });
403
+ })
404
+ })
@@ -96,8 +96,8 @@ const bidderRequest = {
96
96
  refererInfo: {
97
97
  numIframes: 0,
98
98
  reachedTop: true,
99
- referer: 'https://v5demo.datablocks.net/test',
100
- stack: ['https://v5demo.datablocks.net/test']
99
+ referer: 'https://7560.v5demo.datablocks.net/test',
100
+ stack: ['https://7560.v5demo.datablocks.net/test']
101
101
  },
102
102
  start: Date.now(),
103
103
  timeout: 10000
@@ -452,7 +452,7 @@ describe('DatablocksAdapter', function() {
452
452
 
453
453
  it('Returns valid URL', function() {
454
454
  expect(request.url).to.exist;
455
- expect(request.url).to.equal('https://7560.v5demo.datablocks.net/openrtb/?sid=7560');
455
+ expect(request.url).to.equal('https://v5demo.datablocks.net/openrtb/?sid=7560');
456
456
  });
457
457
 
458
458
  it('Creates an array of request objects', function() {