prebid.js 7.33.0 → 7.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/.github/workflows/issue_tracker.yml +26 -15
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.js +1 -1
  4. package/dist/adagioBidAdapter.js +1 -1
  5. package/dist/adbookpspBidAdapter.js +1 -1
  6. package/dist/adgenerationBidAdapter.js +1 -1
  7. package/dist/admaticBidAdapter.js +1 -1
  8. package/dist/admixerBidAdapter.js +1 -1
  9. package/dist/adnuntiusBidAdapter.js +1 -1
  10. package/dist/adrelevantisBidAdapter.js +1 -1
  11. package/dist/adtrgtmeBidAdapter.js +1 -1
  12. package/dist/adxcgBidAdapter.js +1 -1
  13. package/dist/ajaBidAdapter.js +1 -1
  14. package/dist/amxBidAdapter.js +1 -1
  15. package/dist/amxIdSystem.js +1 -1
  16. package/dist/appierAnalyticsAdapter.js +1 -1
  17. package/dist/appnexusBidAdapter.js +1 -1
  18. package/dist/arcspanRtdProvider.js +1 -0
  19. package/dist/asoBidAdapter.js +1 -1
  20. package/dist/axonixBidAdapter.js +1 -1
  21. package/dist/bidglassBidAdapter.js +1 -1
  22. package/dist/big-richmediaBidAdapter.js +1 -1
  23. package/dist/bliinkBidAdapter.js +1 -1
  24. package/dist/bridgewellBidAdapter.js +1 -1
  25. package/dist/brightMountainMediaBidAdapter.js +1 -1
  26. package/dist/carodaBidAdapter.js +1 -1
  27. package/dist/chtnwBidAdapter.js +1 -1
  28. package/dist/concertBidAdapter.js +1 -1
  29. package/dist/connectadBidAdapter.js +1 -1
  30. package/dist/consumableBidAdapter.js +1 -1
  31. package/dist/conversantBidAdapter.js +1 -1
  32. package/dist/craftBidAdapter.js +1 -1
  33. package/dist/criteoBidAdapter.js +1 -1
  34. package/dist/dspxBidAdapter.js +1 -1
  35. package/dist/emx_digitalBidAdapter.js +1 -1
  36. package/dist/eplanningBidAdapter.js +1 -1
  37. package/dist/feedadBidAdapter.js +1 -1
  38. package/dist/finativeBidAdapter.js +1 -1
  39. package/dist/glimpseBidAdapter.js +1 -1
  40. package/dist/gmosspBidAdapter.js +1 -1
  41. package/dist/goldbachBidAdapter.js +1 -1
  42. package/dist/gridBidAdapter.js +1 -1
  43. package/dist/gridNMBidAdapter.js +1 -1
  44. package/dist/gumgumBidAdapter.js +1 -1
  45. package/dist/h12mediaBidAdapter.js +1 -1
  46. package/dist/holidBidAdapter.js +1 -1
  47. package/dist/id5IdSystem.js +1 -1
  48. package/dist/improvedigitalBidAdapter.js +1 -1
  49. package/dist/inmarBidAdapter.js +1 -1
  50. package/dist/insticatorBidAdapter.js +1 -1
  51. package/dist/ixBidAdapter.js +1 -1
  52. package/dist/justpremiumBidAdapter.js +1 -1
  53. package/dist/kargoBidAdapter.js +1 -1
  54. package/dist/konduitAnalyticsAdapter.js +1 -1
  55. package/dist/kueezBidAdapter.js +1 -1
  56. package/dist/kueezRtbBidAdapter.js +1 -1
  57. package/dist/lassoBidAdapter.js +1 -1
  58. package/dist/lifestreetBidAdapter.js +1 -1
  59. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  60. package/dist/logicadBidAdapter.js +1 -1
  61. package/dist/loglyliftBidAdapter.js +1 -1
  62. package/dist/lotamePanoramaIdSystem.js +1 -1
  63. package/dist/magniteAnalyticsAdapter.js +1 -1
  64. package/dist/malltvAnalyticsAdapter.js +1 -1
  65. package/dist/marsmediaBidAdapter.js +1 -1
  66. package/dist/mediafuseBidAdapter.js +1 -1
  67. package/dist/mediasquareBidAdapter.js +1 -1
  68. package/dist/mgidBidAdapter.js +1 -1
  69. package/dist/minutemediaBidAdapter.js +1 -1
  70. package/dist/nextMillenniumBidAdapter.js +1 -1
  71. package/dist/nexx360BidAdapter.js +1 -1
  72. package/dist/not-for-prod/prebid.js +126 -125
  73. package/dist/oguryBidAdapter.js +1 -1
  74. package/dist/onetagBidAdapter.js +1 -1
  75. package/dist/ooloAnalyticsAdapter.js +1 -1
  76. package/dist/openxBidAdapter.js +1 -1
  77. package/dist/ortbConverter.js +1 -1
  78. package/dist/outbrainBidAdapter.js +1 -1
  79. package/dist/parrableIdSystem.js +1 -1
  80. package/dist/pixfutureBidAdapter.js +1 -1
  81. package/dist/prebid-core.js +1 -1
  82. package/dist/prebidServerBidAdapter.js +1 -1
  83. package/dist/publinkIdSystem.js +1 -1
  84. package/dist/pubmaticBidAdapter.js +1 -1
  85. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  86. package/dist/pxyzBidAdapter.js +1 -1
  87. package/dist/quantcastBidAdapter.js +1 -1
  88. package/dist/readpeakBidAdapter.js +1 -1
  89. package/dist/relaidoBidAdapter.js +1 -1
  90. package/dist/rhythmoneBidAdapter.js +1 -1
  91. package/dist/riseBidAdapter.js +1 -1
  92. package/dist/rubiconAnalyticsAdapter.js +1 -1
  93. package/dist/rubiconBidAdapter.js +1 -1
  94. package/dist/seedingAllianceBidAdapter.js +1 -1
  95. package/dist/seedtagBidAdapter.js +1 -1
  96. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  97. package/dist/sharethroughBidAdapter.js +1 -1
  98. package/dist/shinezBidAdapter.js +1 -1
  99. package/dist/smaatoBidAdapter.js +1 -1
  100. package/dist/smartadserverBidAdapter.js +1 -1
  101. package/dist/smartxBidAdapter.js +1 -1
  102. package/dist/smilewantedBidAdapter.js +1 -1
  103. package/dist/sonobiBidAdapter.js +1 -1
  104. package/dist/sovrnAnalyticsAdapter.js +1 -1
  105. package/dist/sovrnBidAdapter.js +1 -1
  106. package/dist/sspBCBidAdapter.js +1 -1
  107. package/dist/sublimeBidAdapter.js +1 -1
  108. package/dist/synacormediaBidAdapter.js +1 -1
  109. package/dist/targetVideoBidAdapter.js +1 -1
  110. package/dist/teadsBidAdapter.js +1 -1
  111. package/dist/trionBidAdapter.js +1 -1
  112. package/dist/tripleliftBidAdapter.js +1 -1
  113. package/dist/ttdBidAdapter.js +1 -1
  114. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  115. package/dist/uid2IdSystem.js +1 -1
  116. package/dist/underdogmediaBidAdapter.js +1 -1
  117. package/dist/undertoneBidAdapter.js +1 -1
  118. package/dist/vidazooBidAdapter.js +1 -1
  119. package/dist/videobyteBidAdapter.js +1 -1
  120. package/dist/visxBidAdapter.js +1 -1
  121. package/dist/vuukleBidAdapter.js +1 -1
  122. package/dist/widespaceBidAdapter.js +1 -1
  123. package/dist/winrBidAdapter.js +1 -1
  124. package/dist/yahoosspBidAdapter.js +1 -1
  125. package/dist/yieldmoBidAdapter.js +1 -1
  126. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  127. package/libraries/ortbConverter/processors/default.js +19 -1
  128. package/modules/.submodules.json +1 -0
  129. package/modules/admaticBidAdapter.js +2 -1
  130. package/modules/admixerBidAdapter.js +26 -4
  131. package/modules/adnuntiusBidAdapter.js +36 -38
  132. package/modules/arcspanRtdProvider.js +73 -0
  133. package/modules/arcspanRtdProvider.md +11 -0
  134. package/modules/bliinkBidAdapter.js +1 -1
  135. package/modules/consumableBidAdapter.js +20 -2
  136. package/modules/criteoBidAdapter.js +1 -1
  137. package/modules/emx_digitalBidAdapter.js +9 -2
  138. package/modules/holidBidAdapter.js +9 -4
  139. package/modules/kargoBidAdapter.js +5 -1
  140. package/modules/lotamePanoramaIdSystem.js +9 -1
  141. package/modules/nextMillenniumBidAdapter.js +19 -9
  142. package/modules/openxBidAdapter.js +5 -0
  143. package/modules/prebidServerBidAdapter/index.js +14 -1
  144. package/modules/prebidServerBidAdapter/ortbConverter.js +1 -1
  145. package/modules/seedingAllianceBidAdapter.js +129 -116
  146. package/modules/tripleliftBidAdapter.js +4 -0
  147. package/package.json +1 -1
  148. package/src/adloader.js +2 -1
  149. package/test/spec/modules/admixerBidAdapter_spec.js +140 -60
  150. package/test/spec/modules/adnuntiusBidAdapter_spec.js +120 -120
  151. package/test/spec/modules/arcspanRtdProvider_spec.js +187 -0
  152. package/test/spec/modules/bliinkBidAdapter_spec.js +7 -7
  153. package/test/spec/modules/consumableBidAdapter_spec.js +46 -0
  154. package/test/spec/modules/emx_digitalBidAdapter_spec.js +30 -1
  155. package/test/spec/modules/holidBidAdapter_spec.js +29 -0
  156. package/test/spec/modules/kargoBidAdapter_spec.js +32 -0
  157. package/test/spec/modules/lotamePanoramaIdSystem_spec.js +16 -10
  158. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +14 -2
  159. package/test/spec/modules/openxBidAdapter_spec.js +41 -0
  160. package/test/spec/modules/openxOrtbBidAdapter_spec.js +41 -0
  161. package/test/spec/modules/prebidServerBidAdapter_spec.js +138 -0
  162. package/test/spec/modules/seedingAllianceAdapter_spec.js +66 -23
  163. package/test/spec/modules/tripleliftBidAdapter_spec.js +13 -0
  164. package/test/spec/ortbConverter/default_processors_spec.js +23 -0
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-trailing-spaces */
1
2
  import {expect} from 'chai';
2
3
  import {
3
4
  PrebidServer as Adapter,
@@ -1505,6 +1506,28 @@ describe('S2S Adapter', function () {
1505
1506
  });
1506
1507
  });
1507
1508
 
1509
+ it('site should not be present when app is present', function () {
1510
+ const _config = {
1511
+ s2sConfig: CONFIG,
1512
+ app: { bundle: 'com.test.app' },
1513
+ site: {
1514
+ publisher: {
1515
+ id: '1234',
1516
+ domain: 'test.com'
1517
+ },
1518
+ content: {
1519
+ language: 'en'
1520
+ }
1521
+ }
1522
+ };
1523
+
1524
+ config.setConfig(_config);
1525
+ adapter.callBids(REQUEST, BID_REQUESTS, addBidResponse, done, ajax);
1526
+ const requestBid = JSON.parse(server.requests[0].requestBody);
1527
+ expect(requestBid.site).to.not.exist;
1528
+ expect(requestBid.app).to.exist.and.to.be.a('object');
1529
+ });
1530
+
1508
1531
  it('adds appnexus aliases to request', function () {
1509
1532
  config.setConfig({ s2sConfig: CONFIG });
1510
1533
 
@@ -1703,6 +1726,121 @@ describe('S2S Adapter', function () {
1703
1726
  }]);
1704
1727
  });
1705
1728
 
1729
+ describe('filterSettings', function () {
1730
+ const getRequestBid = userSync => {
1731
+ let cookieSyncConfig = utils.deepClone(CONFIG);
1732
+ const s2sBidRequest = utils.deepClone(REQUEST);
1733
+ cookieSyncConfig.syncEndpoint = { p1Consent: 'https://prebid.adnxs.com/pbs/v1/cookie_sync' };
1734
+ s2sBidRequest.s2sConfig = cookieSyncConfig;
1735
+
1736
+ config.setConfig({ userSync, s2sConfig: cookieSyncConfig });
1737
+
1738
+ let bidRequest = utils.deepClone(BID_REQUESTS);
1739
+ adapter.callBids(s2sBidRequest, bidRequest, addBidResponse, done, ajax);
1740
+ return JSON.parse(server.requests[0].requestBody);
1741
+ }
1742
+
1743
+ it('correctly adds filterSettings to the cookie_sync request if userSync.filterSettings is present in the config and only the all key is present in userSync.filterSettings', function () {
1744
+ const userSync = {
1745
+ filterSettings: {
1746
+ all: {
1747
+ bidders: ['appnexus', 'rubicon', 'pubmatic'],
1748
+ filter: 'exclude'
1749
+ }
1750
+ }
1751
+ };
1752
+ const requestBid = getRequestBid(userSync);
1753
+
1754
+ expect(requestBid.filterSettings).to.deep.equal({
1755
+ 'image': {
1756
+ 'bidders': ['appnexus', 'rubicon', 'pubmatic'],
1757
+ 'filter': 'exclude'
1758
+ },
1759
+ 'iframe': {
1760
+ 'bidders': ['appnexus', 'rubicon', 'pubmatic'],
1761
+ 'filter': 'exclude'
1762
+ }
1763
+ });
1764
+ });
1765
+
1766
+ it('correctly adds filterSettings to the cookie_sync request if userSync.filterSettings is present in the config and only the iframe key is present in userSync.filterSettings', function () {
1767
+ const userSync = {
1768
+ filterSettings: {
1769
+ iframe: {
1770
+ bidders: ['rubicon', 'pubmatic'],
1771
+ filter: 'include'
1772
+ }
1773
+ }
1774
+ };
1775
+ const requestBid = getRequestBid(userSync);
1776
+
1777
+ expect(requestBid.filterSettings).to.deep.equal({
1778
+ 'image': {
1779
+ 'bidders': '*',
1780
+ 'filter': 'include'
1781
+ },
1782
+ 'iframe': {
1783
+ 'bidders': ['rubicon', 'pubmatic'],
1784
+ 'filter': 'include'
1785
+ }
1786
+ });
1787
+ });
1788
+
1789
+ it('correctly adds filterSettings to the cookie_sync request if userSync.filterSettings is present in the config and the image and iframe keys are both present in userSync.filterSettings', function () {
1790
+ const userSync = {
1791
+ filterSettings: {
1792
+ image: {
1793
+ bidders: ['triplelift', 'appnexus'],
1794
+ filter: 'include'
1795
+ },
1796
+ iframe: {
1797
+ bidders: ['pulsepoint', 'triplelift', 'appnexus', 'rubicon'],
1798
+ filter: 'exclude'
1799
+ }
1800
+ }
1801
+ };
1802
+ const requestBid = getRequestBid(userSync);
1803
+
1804
+ expect(requestBid.filterSettings).to.deep.equal({
1805
+ 'image': {
1806
+ 'bidders': ['triplelift', 'appnexus'],
1807
+ 'filter': 'include'
1808
+ },
1809
+ 'iframe': {
1810
+ 'bidders': ['pulsepoint', 'triplelift', 'appnexus', 'rubicon'],
1811
+ 'filter': 'exclude'
1812
+ }
1813
+ });
1814
+ });
1815
+
1816
+ it('correctly adds filterSettings to the cookie_sync request if userSync.filterSettings is present in the config and the all and iframe keys are both present in userSync.filterSettings', function () {
1817
+ const userSync = {
1818
+ filterSettings: {
1819
+ all: {
1820
+ bidders: ['triplelift', 'appnexus'],
1821
+ filter: 'include'
1822
+ },
1823
+ iframe: {
1824
+ bidders: ['pulsepoint', 'triplelift', 'appnexus', 'rubicon'],
1825
+ filter: 'exclude'
1826
+ }
1827
+ }
1828
+ };
1829
+ const requestBid = getRequestBid(userSync);
1830
+
1831
+ expect(requestBid.filterSettings).to.deep.equal({
1832
+ 'image': {
1833
+ 'bidders': ['triplelift', 'appnexus'],
1834
+ 'filter': 'include'
1835
+ },
1836
+ 'iframe': {
1837
+ 'bidders': ['pulsepoint', 'triplelift', 'appnexus', 'rubicon'],
1838
+ 'filter': 'exclude'
1839
+ }
1840
+ });
1841
+ });
1842
+ });
1843
+
1706
1844
  it('adds limit to the cookie_sync request if userSyncLimit is greater than 0', function () {
1707
1845
  let cookieSyncConfig = utils.deepClone(CONFIG);
1708
1846
  cookieSyncConfig.syncEndpoint = { p1Consent: 'https://prebid.adnxs.com/pbs/v1/cookie_sync' };
@@ -38,7 +38,7 @@ describe('SeedingAlliance adapter', function () {
38
38
  });
39
39
 
40
40
  it('should have default request structure', function () {
41
- let keys = 'site,device,cur,imp,user,regs'.split(',');
41
+ let keys = 'site,cur,imp,regs'.split(',');
42
42
  let validBidRequests = [{
43
43
  bidId: 'bidId',
44
44
  params: {}
@@ -60,14 +60,17 @@ describe('SeedingAlliance adapter', function () {
60
60
  assert.equal(request.id, validBidRequests[0].auctionId);
61
61
  });
62
62
 
63
- it('Verify the device', function () {
63
+ it('Verify the site url', function () {
64
+ let siteUrl = 'https://www.yourdomain.tld/your-directory/';
64
65
  let validBidRequests = [{
65
66
  bidId: 'bidId',
66
- params: {}
67
+ params: {
68
+ url: siteUrl
69
+ }
67
70
  }];
68
71
  let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data);
69
72
 
70
- assert.equal(request.device.ua, navigator.userAgent);
73
+ assert.equal(request.site.page, siteUrl);
71
74
  });
72
75
 
73
76
  it('Verify native asset ids', function () {
@@ -109,7 +112,7 @@ describe('SeedingAlliance adapter', function () {
109
112
  });
110
113
 
111
114
  describe('interpretResponse', function () {
112
- const goodResponse = {
115
+ const goodNativeResponse = {
113
116
  body: {
114
117
  cur: 'EUR',
115
118
  id: '4b516b80-886e-4ec0-82ae-9209e6d625fb',
@@ -136,51 +139,91 @@ describe('SeedingAlliance adapter', function () {
136
139
  ]
137
140
  }
138
141
  };
142
+
143
+ const goodBannerResponse = {
144
+ body: {
145
+ cur: 'EUR',
146
+ id: 'b4516b80-886e-4ec0-82ae-9209e6d625fb',
147
+ seatbid: [
148
+ {
149
+ seat: 'seedingAlliance',
150
+ bid: [{
151
+ adm: '<iframe src="https://domain.tld/cds/delivery?wp=0.90"></iframe>',
152
+ impid: 1,
153
+ price: 0.90,
154
+ h: 250,
155
+ w: 300
156
+ }]
157
+ }
158
+ ]
159
+ }
160
+ };
161
+
139
162
  const badResponse = { body: {
140
163
  cur: 'EUR',
141
164
  id: '4b516b80-886e-4ec0-82ae-9209e6d625fb',
142
165
  seatbid: []
143
166
  }};
144
167
 
145
- const bidRequest = {
168
+ const bidNativeRequest = {
146
169
  data: {},
147
- bids: [{ bidId: 'bidId1' }]
170
+ bidRequests: [{bidId: 'bidId1', nativeParams: {title: {required: true, len: 800}}}]
171
+ };
172
+
173
+ const bidBannerRequest = {
174
+ data: {},
175
+ bidRequests: [{bidId: 'bidId1', sizes: [300, 250]}]
148
176
  };
149
177
 
150
178
  it('should return null if body is missing or empty', function () {
151
- const result = spec.interpretResponse(badResponse, bidRequest);
179
+ const result = spec.interpretResponse(badResponse, bidNativeRequest);
152
180
  assert.equal(result.length, 0);
153
181
 
154
182
  delete badResponse.body
155
183
 
156
- const result1 = spec.interpretResponse(badResponse, bidRequest);
184
+ const result1 = spec.interpretResponse(badResponse, bidNativeRequest);
157
185
  assert.equal(result.length, 0);
158
186
  });
159
187
 
160
188
  it('should return the correct params', function () {
161
- const result = spec.interpretResponse(goodResponse, bidRequest);
162
- const bid = goodResponse.body.seatbid[0].bid[0];
163
-
164
- assert.deepEqual(result[0].currency, goodResponse.body.cur);
165
- assert.deepEqual(result[0].requestId, bidRequest.bids[0].bidId);
166
- assert.deepEqual(result[0].cpm, bid.price);
167
- assert.deepEqual(result[0].creativeId, bid.crid);
168
- assert.deepEqual(result[0].mediaType, 'native');
169
- assert.deepEqual(result[0].bidderCode, 'seedingAlliance');
189
+ const resultNative = spec.interpretResponse(goodNativeResponse, bidNativeRequest);
190
+ const bidNative = goodNativeResponse.body.seatbid[0].bid[0];
191
+
192
+ assert.deepEqual(resultNative[0].bidderCode, 'seedingAlliance');
193
+ assert.deepEqual(resultNative[0].currency, goodNativeResponse.body.cur);
194
+ assert.deepEqual(resultNative[0].requestId, bidNativeRequest.bidRequests[0].bidId);
195
+ assert.deepEqual(resultNative[0].cpm, bidNative.price);
196
+ assert.deepEqual(resultNative[0].creativeId, bidNative.crid);
197
+ assert.deepEqual(resultNative[0].mediaType, 'native');
198
+
199
+ const resultBanner = spec.interpretResponse(goodBannerResponse, bidBannerRequest);
200
+
201
+ assert.deepEqual(resultBanner[0].bidderCode, 'seedingAlliance');
202
+ assert.deepEqual(resultBanner[0].mediaType, 'banner');
203
+ assert.deepEqual(resultBanner[0].width, bidBannerRequest.bidRequests[0].sizes[0]);
204
+ assert.deepEqual(resultBanner[0].height, bidBannerRequest.bidRequests[0].sizes[1]);
170
205
  });
171
206
 
172
- it('should return the correct tracking links', function () {
173
- const result = spec.interpretResponse(goodResponse, bidRequest);
174
- const bid = goodResponse.body.seatbid[0].bid[0];
207
+ it('should return the correct native tracking links', function () {
208
+ const result = spec.interpretResponse(goodNativeResponse, bidNativeRequest);
209
+ const bid = goodNativeResponse.body.seatbid[0].bid[0];
175
210
  const regExpPrice = new RegExp('price=' + bid.price);
176
211
 
177
212
  result[0].native.clickTrackers.forEach(function (clickTracker) {
178
- assert.ok(clickTracker.search(regExpPrice) > -1);
213
+ assert.ok(clickTracker.search(regExpPrice) > -1);
179
214
  });
180
215
 
181
216
  result[0].native.impressionTrackers.forEach(function (impTracker) {
182
- assert.ok(impTracker.search(regExpPrice) > -1);
217
+ assert.ok(impTracker.search(regExpPrice) > -1);
183
218
  });
184
219
  });
220
+
221
+ it('should return the correct banner content', function () {
222
+ const result = spec.interpretResponse(goodBannerResponse, bidBannerRequest);
223
+ const bid = goodBannerResponse.body.seatbid[0].bid[0];
224
+ const regExpContent = new RegExp('<iframe.+?' + bid.price + '.+?</iframe>');
225
+
226
+ assert.ok(result[0].ad.search(regExpContent) > -1);
227
+ });
185
228
  });
186
229
  });
@@ -1168,6 +1168,19 @@ describe('triplelift adapter', function () {
1168
1168
  }
1169
1169
  })
1170
1170
  });
1171
+ it('should add gpp consent data to bid request object if gpp data exists', function() {
1172
+ bidderRequest.ortb2 = {
1173
+ regs: {
1174
+ 'gpp': 'BOJ/P2HOJ/P2HABABMAAAAAZ+A==',
1175
+ 'gpp_sid': [7]
1176
+ }
1177
+ }
1178
+ const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
1179
+ expect(request.data.regs).to.deep.equal({
1180
+ 'gpp': 'BOJ/P2HOJ/P2HABABMAAAAAZ+A==',
1181
+ 'gpp_sid': [7]
1182
+ })
1183
+ });
1171
1184
  });
1172
1185
 
1173
1186
  describe('interpretResponse', function () {
@@ -0,0 +1,23 @@
1
+ import {onlyOneClientSection} from '../../../libraries/ortbConverter/processors/default.js';
2
+
3
+ describe('onlyOneClientSection', () => {
4
+ [
5
+ [['app'], 'app'],
6
+ [['site'], 'site'],
7
+ [['dooh'], 'dooh'],
8
+ [['app', 'site'], 'app'],
9
+ [['dooh', 'app', 'site'], 'dooh'],
10
+ [['dooh', 'site'], 'dooh']
11
+ ].forEach(([sections, winner]) => {
12
+ it(`should leave only ${winner} in request when it contains ${sections.join(', ')}`, () => {
13
+ const req = Object.fromEntries(sections.map(s => [s, {foo: 'bar'}]));
14
+ onlyOneClientSection(req);
15
+ expect(Object.keys(req)).to.eql([winner]);
16
+ })
17
+ });
18
+ it('should not choke if none of the sections are in the request', () => {
19
+ const req = {};
20
+ onlyOneClientSection(req);
21
+ expect(req).to.eql({});
22
+ });
23
+ });