prebid.js 7.32.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 (180) 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/consentManagementUsp.js +1 -1
  31. package/dist/consumableBidAdapter.js +1 -1
  32. package/dist/conversantBidAdapter.js +1 -1
  33. package/dist/craftBidAdapter.js +1 -1
  34. package/dist/criteoBidAdapter.js +1 -1
  35. package/dist/dspxBidAdapter.js +1 -1
  36. package/dist/emx_digitalBidAdapter.js +1 -1
  37. package/dist/eplanningBidAdapter.js +1 -1
  38. package/dist/feedadBidAdapter.js +1 -1
  39. package/dist/finativeBidAdapter.js +1 -1
  40. package/dist/glimpseBidAdapter.js +1 -1
  41. package/dist/gmosspBidAdapter.js +1 -1
  42. package/dist/goldbachBidAdapter.js +1 -1
  43. package/dist/gridBidAdapter.js +1 -1
  44. package/dist/gridNMBidAdapter.js +1 -1
  45. package/dist/gumgumBidAdapter.js +1 -1
  46. package/dist/h12mediaBidAdapter.js +1 -1
  47. package/dist/holidBidAdapter.js +1 -1
  48. package/dist/id5IdSystem.js +1 -1
  49. package/dist/improvedigitalBidAdapter.js +1 -1
  50. package/dist/inmarBidAdapter.js +1 -1
  51. package/dist/insticatorBidAdapter.js +1 -1
  52. package/dist/ixBidAdapter.js +1 -1
  53. package/dist/justpremiumBidAdapter.js +1 -1
  54. package/dist/kargoBidAdapter.js +1 -1
  55. package/dist/konduitAnalyticsAdapter.js +1 -1
  56. package/dist/kueezBidAdapter.js +1 -1
  57. package/dist/kueezRtbBidAdapter.js +1 -1
  58. package/dist/lassoBidAdapter.js +1 -1
  59. package/dist/lifestreetBidAdapter.js +1 -1
  60. package/dist/liveIntentIdSystem.js +1 -1
  61. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  62. package/dist/logicadBidAdapter.js +1 -1
  63. package/dist/loglyliftBidAdapter.js +1 -1
  64. package/dist/lotamePanoramaIdSystem.js +1 -1
  65. package/dist/magniteAnalyticsAdapter.js +1 -1
  66. package/dist/malltvAnalyticsAdapter.js +1 -1
  67. package/dist/marsmediaBidAdapter.js +1 -1
  68. package/dist/mediafuseBidAdapter.js +1 -1
  69. package/dist/mediasquareBidAdapter.js +1 -1
  70. package/dist/mgidBidAdapter.js +1 -1
  71. package/dist/minutemediaBidAdapter.js +1 -1
  72. package/dist/nextMillenniumBidAdapter.js +1 -1
  73. package/dist/nexx360BidAdapter.js +1 -1
  74. package/dist/not-for-prod/prebid.js +129 -128
  75. package/dist/oguryBidAdapter.js +1 -1
  76. package/dist/onetagBidAdapter.js +1 -1
  77. package/dist/ooloAnalyticsAdapter.js +1 -1
  78. package/dist/openxBidAdapter.js +1 -1
  79. package/dist/ortbConverter.js +1 -1
  80. package/dist/outbrainBidAdapter.js +1 -1
  81. package/dist/parrableIdSystem.js +1 -1
  82. package/dist/pixfutureBidAdapter.js +1 -1
  83. package/dist/prebid-core.js +1 -1
  84. package/dist/prebidServerBidAdapter.js +1 -1
  85. package/dist/priceFloors.js +1 -1
  86. package/dist/publinkIdSystem.js +1 -1
  87. package/dist/pubmaticBidAdapter.js +1 -1
  88. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  89. package/dist/pxyzBidAdapter.js +1 -1
  90. package/dist/quantcastBidAdapter.js +1 -1
  91. package/dist/readpeakBidAdapter.js +1 -1
  92. package/dist/relaidoBidAdapter.js +1 -1
  93. package/dist/rhythmoneBidAdapter.js +1 -1
  94. package/dist/riseBidAdapter.js +1 -1
  95. package/dist/rubiconAnalyticsAdapter.js +1 -1
  96. package/dist/rubiconBidAdapter.js +1 -1
  97. package/dist/seedingAllianceBidAdapter.js +1 -1
  98. package/dist/seedtagBidAdapter.js +1 -1
  99. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  100. package/dist/sharethroughBidAdapter.js +1 -1
  101. package/dist/shinezBidAdapter.js +1 -1
  102. package/dist/smaatoBidAdapter.js +1 -1
  103. package/dist/smartadserverBidAdapter.js +1 -1
  104. package/dist/smartxBidAdapter.js +1 -1
  105. package/dist/smilewantedBidAdapter.js +1 -1
  106. package/dist/sonobiBidAdapter.js +1 -1
  107. package/dist/sovrnAnalyticsAdapter.js +1 -1
  108. package/dist/sovrnBidAdapter.js +1 -1
  109. package/dist/sspBCBidAdapter.js +1 -1
  110. package/dist/sublimeBidAdapter.js +1 -1
  111. package/dist/synacormediaBidAdapter.js +1 -1
  112. package/dist/targetVideoBidAdapter.js +1 -1
  113. package/dist/teadsBidAdapter.js +1 -1
  114. package/dist/trionBidAdapter.js +1 -1
  115. package/dist/tripleliftBidAdapter.js +1 -1
  116. package/dist/ttdBidAdapter.js +1 -1
  117. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  118. package/dist/uid2IdSystem.js +1 -1
  119. package/dist/underdogmediaBidAdapter.js +1 -1
  120. package/dist/undertoneBidAdapter.js +1 -1
  121. package/dist/vidazooBidAdapter.js +1 -1
  122. package/dist/videobyteBidAdapter.js +1 -1
  123. package/dist/visxBidAdapter.js +1 -1
  124. package/dist/vuukleBidAdapter.js +1 -1
  125. package/dist/widespaceBidAdapter.js +1 -1
  126. package/dist/winrBidAdapter.js +1 -1
  127. package/dist/yahoosspBidAdapter.js +1 -1
  128. package/dist/yieldmoBidAdapter.js +1 -1
  129. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  130. package/libraries/ortbConverter/processors/default.js +19 -1
  131. package/modules/.submodules.json +1 -0
  132. package/modules/admaticBidAdapter.js +2 -1
  133. package/modules/admixerBidAdapter.js +26 -4
  134. package/modules/adnuntiusBidAdapter.js +36 -38
  135. package/modules/arcspanRtdProvider.js +73 -0
  136. package/modules/arcspanRtdProvider.md +11 -0
  137. package/modules/bliinkBidAdapter.js +1 -1
  138. package/modules/consentManagementUsp.js +10 -10
  139. package/modules/consumableBidAdapter.js +20 -2
  140. package/modules/criteoBidAdapter.js +1 -1
  141. package/modules/emx_digitalBidAdapter.js +9 -2
  142. package/modules/holidBidAdapter.js +9 -4
  143. package/modules/id5IdSystem.js +3 -1
  144. package/modules/ixBidAdapter.js +25 -6
  145. package/modules/kargoBidAdapter.js +5 -1
  146. package/modules/lotamePanoramaIdSystem.js +9 -1
  147. package/modules/nextMillenniumBidAdapter.js +19 -9
  148. package/modules/nexx360BidAdapter.js +2 -1
  149. package/modules/openxBidAdapter.js +5 -0
  150. package/modules/prebidServerBidAdapter/index.js +14 -1
  151. package/modules/prebidServerBidAdapter/ortbConverter.js +1 -1
  152. package/modules/priceFloors.js +11 -5
  153. package/modules/seedingAllianceBidAdapter.js +129 -116
  154. package/modules/seedtagBidAdapter.js +20 -6
  155. package/modules/targetVideoBidAdapter.js +1 -1
  156. package/modules/tripleliftBidAdapter.js +4 -0
  157. package/package.json +2 -2
  158. package/src/adloader.js +2 -1
  159. package/src/utils/promise.js +8 -0
  160. package/test/spec/modules/admixerBidAdapter_spec.js +140 -60
  161. package/test/spec/modules/adnuntiusBidAdapter_spec.js +120 -120
  162. package/test/spec/modules/arcspanRtdProvider_spec.js +187 -0
  163. package/test/spec/modules/bliinkBidAdapter_spec.js +7 -7
  164. package/test/spec/modules/consentManagementUsp_spec.js +15 -2
  165. package/test/spec/modules/consumableBidAdapter_spec.js +46 -0
  166. package/test/spec/modules/emx_digitalBidAdapter_spec.js +30 -1
  167. package/test/spec/modules/holidBidAdapter_spec.js +29 -0
  168. package/test/spec/modules/ixBidAdapter_spec.js +117 -6
  169. package/test/spec/modules/kargoBidAdapter_spec.js +32 -0
  170. package/test/spec/modules/lotamePanoramaIdSystem_spec.js +16 -10
  171. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +14 -2
  172. package/test/spec/modules/openxBidAdapter_spec.js +41 -0
  173. package/test/spec/modules/openxOrtbBidAdapter_spec.js +41 -0
  174. package/test/spec/modules/prebidServerBidAdapter_spec.js +138 -0
  175. package/test/spec/modules/priceFloors_spec.js +155 -0
  176. package/test/spec/modules/seedingAllianceAdapter_spec.js +66 -23
  177. package/test/spec/modules/seedtagBidAdapter_spec.js +58 -17
  178. package/test/spec/modules/targetVideoBidAdapter_spec.js +2 -2
  179. package/test/spec/modules/tripleliftBidAdapter_spec.js +13 -0
  180. package/test/spec/ortbConverter/default_processors_spec.js +23 -0
@@ -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
  });
@@ -33,30 +33,60 @@ function createInStreamSlotConfig(mediaType) {
33
33
  });
34
34
  }
35
35
 
36
+ const createBannerSlotConfig = (placement, mediatypes) => {
37
+ return getSlotConfigs(mediatypes || { banner: {} }, {
38
+ publisherId: PUBLISHER_ID,
39
+ adUnitId: ADUNIT_ID,
40
+ placement,
41
+ });
42
+ };
43
+
36
44
  describe('Seedtag Adapter', function () {
37
45
  describe('isBidRequestValid method', function () {
38
46
  describe('returns true', function () {
39
47
  describe('when banner slot config has all mandatory params', () => {
40
- describe('and placement has the correct value', function () {
41
- const createBannerSlotConfig = (placement) => {
42
- return getSlotConfigs(
43
- { banner: {} },
44
- {
45
- publisherId: PUBLISHER_ID,
46
- adUnitId: ADUNIT_ID,
47
- placement,
48
- }
48
+ const placements = ['inBanner', 'inImage', 'inScreen', 'inArticle'];
49
+ placements.forEach((placement) => {
50
+ it(placement + 'should be valid', function () {
51
+ const isBidRequestValid = spec.isBidRequestValid(
52
+ createBannerSlotConfig(placement)
49
53
  );
50
- };
51
- const placements = ['inBanner', 'inImage', 'inScreen', 'inArticle'];
52
- placements.forEach((placement) => {
53
- it('should be ' + placement, function () {
54
+ expect(isBidRequestValid).to.equal(true);
55
+ });
56
+
57
+ it(
58
+ placement +
59
+ ' should be valid when has display and video mediatypes, and video context is outstream',
60
+ function () {
54
61
  const isBidRequestValid = spec.isBidRequestValid(
55
- createBannerSlotConfig(placement)
62
+ createBannerSlotConfig(placement, {
63
+ banner: {},
64
+ video: {
65
+ context: 'outstream',
66
+ playerSize: [[600, 200]],
67
+ },
68
+ })
56
69
  );
57
70
  expect(isBidRequestValid).to.equal(true);
58
- });
59
- });
71
+ }
72
+ );
73
+
74
+ it(
75
+ placement +
76
+ " shouldn't be valid when has display and video mediatypes, and video context is instream",
77
+ function () {
78
+ const isBidRequestValid = spec.isBidRequestValid(
79
+ createBannerSlotConfig(placement, {
80
+ banner: {},
81
+ video: {
82
+ context: 'instream',
83
+ playerSize: [[600, 200]],
84
+ },
85
+ })
86
+ );
87
+ expect(isBidRequestValid).to.equal(false);
88
+ }
89
+ );
60
90
  });
61
91
  });
62
92
  describe('when video slot has all mandatory params', function () {
@@ -70,7 +100,18 @@ describe('Seedtag Adapter', function () {
70
100
  const isBidRequestValid = spec.isBidRequestValid(slotConfig);
71
101
  expect(isBidRequestValid).to.equal(true);
72
102
  });
73
- it('should return true, when video context is instream, but placement is not inStream', function () {
103
+ it('should return true, when video context is instream and mediatype is video and banner', function () {
104
+ const slotConfig = createInStreamSlotConfig({
105
+ video: {
106
+ context: 'instream',
107
+ playerSize: [[600, 200]],
108
+ },
109
+ banner: {},
110
+ });
111
+ const isBidRequestValid = spec.isBidRequestValid(slotConfig);
112
+ expect(isBidRequestValid).to.equal(true);
113
+ });
114
+ it('should return false, when video context is instream, but placement is not inStream', function () {
74
115
  const slotConfig = getSlotConfigs(
75
116
  {
76
117
  video: {
@@ -58,7 +58,7 @@ describe('TargetVideo Bid Adapter', function() {
58
58
  'uuid': '84ab500420319d',
59
59
  'ads': [{
60
60
  'ad_type': 'video',
61
- 'cpm': 0.500000,
61
+ 'cpm': 0.675000,
62
62
  'notify_url': 'https://www.target-video.com/',
63
63
  'rtb': {
64
64
  'video': {
@@ -87,7 +87,7 @@ describe('TargetVideo Bid Adapter', function() {
87
87
 
88
88
  const bid = bidResponse[0];
89
89
  expect(bid).to.not.be.empty;
90
- expect(bid.cpm).to.equal(0.675);
90
+ expect(bid.cpm).to.equal(0.5);
91
91
  expect(bid.width).to.equal(300);
92
92
  expect(bid.height).to.equal(250);
93
93
  expect(bid.ad).to.include('<script src="https://player.target-video.com/custom/targetvideo-banner.js"></script>')
@@ -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
+ });