prebid.js 7.51.0 → 7.53.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 (277) hide show
  1. package/dist/1plusXRtdProvider.js +1 -1
  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/adkernelBidAdapter.js +1 -1
  8. package/dist/adqueryBidAdapter.js +1 -1
  9. package/dist/adrelevantisBidAdapter.js +1 -1
  10. package/dist/adriverIdSystem.js +1 -1
  11. package/dist/adtrgtmeBidAdapter.js +1 -1
  12. package/dist/adxcgBidAdapter.js +1 -1
  13. package/dist/adyoulikeBidAdapter.js +1 -1
  14. package/dist/airgridRtdProvider.js +1 -1
  15. package/dist/ajaBidAdapter.js +1 -1
  16. package/dist/allowActivities.js +1 -0
  17. package/dist/amxBidAdapter.js +1 -1
  18. package/dist/amxIdSystem.js +1 -1
  19. package/dist/appierAnalyticsAdapter.js +1 -1
  20. package/dist/appnexusBidAdapter.js +1 -1
  21. package/dist/asoBidAdapter.js +1 -1
  22. package/dist/axonixBidAdapter.js +1 -1
  23. package/dist/beopBidAdapter.js +1 -1
  24. package/dist/bidglassBidAdapter.js +1 -1
  25. package/dist/big-richmediaBidAdapter.js +1 -1
  26. package/dist/bridgewellBidAdapter.js +1 -1
  27. package/dist/brightMountainMediaBidAdapter.js +1 -1
  28. package/dist/carodaBidAdapter.js +1 -1
  29. package/dist/chtnwBidAdapter.js +1 -1
  30. package/dist/conceptxBidAdapter.js +1 -0
  31. package/dist/concertBidAdapter.js +1 -1
  32. package/dist/connectIdSystem.js +1 -1
  33. package/dist/connectadBidAdapter.js +1 -1
  34. package/dist/consumableBidAdapter.js +1 -1
  35. package/dist/conversantAnalyticsAdapter.js +1 -1
  36. package/dist/conversantBidAdapter.js +1 -1
  37. package/dist/craftBidAdapter.js +1 -1
  38. package/dist/criteoBidAdapter.js +1 -1
  39. package/dist/cwireBidAdapter.js +1 -1
  40. package/dist/dependencies.json +6 -0
  41. package/dist/dspxBidAdapter.js +1 -1
  42. package/dist/eplanningBidAdapter.js +1 -1
  43. package/dist/eskimiBidAdapter.js +1 -1
  44. package/dist/euidIdSystem.js +1 -0
  45. package/dist/feedadBidAdapter.js +1 -1
  46. package/dist/finativeBidAdapter.js +1 -1
  47. package/dist/freepassIdSystem.js +1 -0
  48. package/dist/freewheel-sspBidAdapter.js +1 -1
  49. package/dist/gdprEnforcement.js +1 -1
  50. package/dist/glimpseBidAdapter.js +1 -1
  51. package/dist/gmosspBidAdapter.js +1 -1
  52. package/dist/goldbachBidAdapter.js +1 -1
  53. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  54. package/dist/greenbidsRtdProvider.js +1 -1
  55. package/dist/gridBidAdapter.js +1 -1
  56. package/dist/growthCodeRtdProvider.js +1 -0
  57. package/dist/gumgumBidAdapter.js +1 -1
  58. package/dist/h12mediaBidAdapter.js +1 -1
  59. package/dist/id5IdSystem.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/ixBidAdapter.js +1 -1
  64. package/dist/justpremiumBidAdapter.js +1 -1
  65. package/dist/kargoBidAdapter.js +1 -1
  66. package/dist/konduitAnalyticsAdapter.js +1 -1
  67. package/dist/kueezBidAdapter.js +1 -1
  68. package/dist/kueezRtbBidAdapter.js +1 -1
  69. package/dist/kulturemediaBidAdapter.js +1 -1
  70. package/dist/lassoBidAdapter.js +1 -1
  71. package/dist/lifestreetBidAdapter.js +1 -1
  72. package/dist/limelightDigitalBidAdapter.js +1 -1
  73. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  74. package/dist/logicadBidAdapter.js +1 -1
  75. package/dist/loglyliftBidAdapter.js +1 -1
  76. package/dist/magniteAnalyticsAdapter.js +1 -1
  77. package/dist/malltvAnalyticsAdapter.js +1 -1
  78. package/dist/marsmediaBidAdapter.js +1 -1
  79. package/dist/mediafuseBidAdapter.js +1 -1
  80. package/dist/mediasquareBidAdapter.js +1 -1
  81. package/dist/mgidBidAdapter.js +1 -1
  82. package/dist/minutemediaBidAdapter.js +1 -1
  83. package/dist/minutemediaplusBidAdapter.js +1 -1
  84. package/dist/nexx360BidAdapter.js +1 -1
  85. package/dist/not-for-prod/prebid.js +154 -146
  86. package/dist/objectGuard.js +1 -0
  87. package/dist/oguryBidAdapter.js +1 -1
  88. package/dist/onetagBidAdapter.js +1 -1
  89. package/dist/ooloAnalyticsAdapter.js +1 -1
  90. package/dist/optidigitalBidAdapter.js +1 -1
  91. package/dist/outbrainBidAdapter.js +1 -1
  92. package/dist/oxxionAnalyticsAdapter.js +1 -0
  93. package/dist/pairIdSystem.js +1 -1
  94. package/dist/parrableIdSystem.js +1 -1
  95. package/dist/pixfutureBidAdapter.js +1 -1
  96. package/dist/prebid-core.js +1 -1
  97. package/dist/proxistoreBidAdapter.js +1 -1
  98. package/dist/publinkIdSystem.js +1 -1
  99. package/dist/pubmaticBidAdapter.js +1 -1
  100. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  101. package/dist/pxyzBidAdapter.js +1 -1
  102. package/dist/quantcastBidAdapter.js +1 -1
  103. package/dist/readpeakBidAdapter.js +1 -1
  104. package/dist/relaidoBidAdapter.js +1 -1
  105. package/dist/retailspotBidAdapter.js +1 -1
  106. package/dist/rhythmoneBidAdapter.js +1 -1
  107. package/dist/richaudienceBidAdapter.js +1 -1
  108. package/dist/riseBidAdapter.js +1 -1
  109. package/dist/rtdModule.js +1 -1
  110. package/dist/rubiconAnalyticsAdapter.js +1 -1
  111. package/dist/rubiconBidAdapter.js +1 -1
  112. package/dist/schain.js +1 -1
  113. package/dist/seedingAllianceBidAdapter.js +1 -1
  114. package/dist/seedtagBidAdapter.js +1 -1
  115. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  116. package/dist/sharethroughBidAdapter.js +1 -1
  117. package/dist/shinezBidAdapter.js +1 -1
  118. package/dist/sirdataRtdProvider.js +1 -1
  119. package/dist/smaatoBidAdapter.js +1 -1
  120. package/dist/smartadserverBidAdapter.js +1 -1
  121. package/dist/smartxBidAdapter.js +1 -1
  122. package/dist/smilewantedBidAdapter.js +1 -1
  123. package/dist/sonobiBidAdapter.js +1 -1
  124. package/dist/sovrnAnalyticsAdapter.js +1 -1
  125. package/dist/sovrnBidAdapter.js +1 -1
  126. package/dist/sspBCBidAdapter.js +1 -1
  127. package/dist/stroeerCoreBidAdapter.js +1 -1
  128. package/dist/stvBidAdapter.js +1 -1
  129. package/dist/sublimeBidAdapter.js +1 -1
  130. package/dist/synacormediaBidAdapter.js +1 -1
  131. package/dist/targetVideoBidAdapter.js +1 -1
  132. package/dist/teadsBidAdapter.js +1 -1
  133. package/dist/trionBidAdapter.js +1 -1
  134. package/dist/tripleliftBidAdapter.js +1 -1
  135. package/dist/ttdBidAdapter.js +1 -1
  136. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  137. package/dist/uid2IdSystem.js +1 -1
  138. package/dist/uid2IdSystem_shared.js +1 -0
  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/videobyteBidAdapter.js +1 -1
  144. package/dist/viouslyBidAdapter.js +1 -1
  145. package/dist/visxBidAdapter.js +1 -1
  146. package/dist/vuukleBidAdapter.js +1 -1
  147. package/dist/weboramaRtdProvider.js +1 -1
  148. package/dist/widespaceBidAdapter.js +1 -1
  149. package/dist/winrBidAdapter.js +1 -1
  150. package/dist/yahoosspBidAdapter.js +1 -1
  151. package/dist/yieldlabBidAdapter.js +1 -1
  152. package/dist/yieldmoBidAdapter.js +1 -1
  153. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  154. package/dist/zeta_global_sspBidAdapter.js +1 -1
  155. package/integrationExamples/gpt/growthcode.html +20 -9
  156. package/integrationExamples/gpt/userId_example.html +20 -6
  157. package/libraries/objectGuard/objectGuard.js +108 -0
  158. package/libraries/objectGuard/ortbGuard.js +88 -0
  159. package/modules/.submodules.json +3 -1
  160. package/modules/1plusXRtdProvider.js +31 -60
  161. package/modules/adagioBidAdapter.js +86 -24
  162. package/modules/adgenerationBidAdapter.js +14 -5
  163. package/modules/adkernelBidAdapter.js +2 -2
  164. package/modules/adriverIdSystem.js +1 -1
  165. package/modules/airgridRtdProvider.js +11 -12
  166. package/modules/allowActivities.js +74 -0
  167. package/modules/asoBidAdapter.js +2 -1
  168. package/modules/beopBidAdapter.js +6 -0
  169. package/modules/conceptxBidAdapter.js +70 -0
  170. package/modules/conceptxBidAdapter.md +36 -0
  171. package/modules/connectIdSystem.js +89 -13
  172. package/modules/connectIdSystem.md +4 -7
  173. package/modules/criteoBidAdapter.js +18 -2
  174. package/modules/eskimiBidAdapter.js +171 -41
  175. package/modules/eskimiBidAdapter.md +35 -16
  176. package/modules/euidIdSystem.js +121 -0
  177. package/modules/euidIdSystem.md +131 -0
  178. package/modules/freepassIdSystem.js +61 -0
  179. package/modules/freepassIdSystem.md +47 -0
  180. package/modules/gdprEnforcement.js +98 -169
  181. package/modules/greenbidsAnalyticsAdapter.js +1 -1
  182. package/modules/growthCodeRtdProvider.js +131 -0
  183. package/modules/growthCodeRtdProvider.md +55 -0
  184. package/modules/id5IdSystem.js +3 -5
  185. package/modules/ixBidAdapter.js +17 -3
  186. package/modules/limelightDigitalBidAdapter.js +1 -1
  187. package/modules/logicadBidAdapter.js +14 -1
  188. package/modules/mediasquareBidAdapter.js +13 -5
  189. package/modules/nexx360BidAdapter.js +1 -0
  190. package/modules/oxxionAnalyticsAdapter.js +212 -0
  191. package/modules/oxxionAnalyticsAdapter.md +33 -0
  192. package/modules/pairIdSystem.js +16 -11
  193. package/modules/proxistoreBidAdapter.js +11 -14
  194. package/modules/richaudienceBidAdapter.js +10 -1
  195. package/modules/riseBidAdapter.js +1 -1
  196. package/modules/rtdModule/index.js +12 -1
  197. package/modules/schain.js +2 -2
  198. package/modules/sharethroughBidAdapter.js +2 -2
  199. package/modules/sirdataRtdProvider.js +73 -146
  200. package/modules/smartadserverBidAdapter.js +5 -0
  201. package/modules/sovrnBidAdapter.js +4 -1
  202. package/modules/stroeerCoreBidAdapter.js +55 -6
  203. package/modules/stvBidAdapter.js +34 -1
  204. package/modules/uid2IdSystem.js +27 -210
  205. package/modules/uid2IdSystem.md +104 -23
  206. package/modules/uid2IdSystem_shared.js +232 -0
  207. package/modules/undertoneBidAdapter.js +9 -1
  208. package/modules/userId/eids.js +8 -0
  209. package/modules/userId/index.js +69 -41
  210. package/modules/userId/userId.md +2 -1
  211. package/modules/viouslyBidAdapter.js +2 -2
  212. package/modules/weboramaRtdProvider.js +25 -95
  213. package/modules/weboramaRtdProvider.md +4 -4
  214. package/modules/yahoosspBidAdapter.js +45 -3
  215. package/modules/yahoosspBidAdapter.md +1 -1
  216. package/modules/yieldlabBidAdapter.js +23 -14
  217. package/modules/zeta_global_sspBidAdapter.js +28 -22
  218. package/package.json +1 -1
  219. package/src/activities/activities.js +47 -0
  220. package/src/activities/activityParams.js +8 -0
  221. package/src/activities/modules.js +1 -1
  222. package/src/activities/params.js +59 -0
  223. package/src/activities/redactor.js +157 -0
  224. package/src/activities/rules.js +95 -0
  225. package/src/adapterManager.js +45 -8
  226. package/src/adloader.js +1 -0
  227. package/src/fpd/rootDomain.js +1 -1
  228. package/src/prebid.js +1 -1
  229. package/src/storageManager.js +57 -44
  230. package/src/userSync.js +35 -18
  231. package/test/spec/activities/allowActivites_spec.js +138 -0
  232. package/test/spec/activities/objectGuard_spec.js +144 -0
  233. package/test/spec/activities/ortbGuard_spec.js +140 -0
  234. package/test/spec/activities/params_spec.js +25 -0
  235. package/test/spec/activities/redactor_spec.js +296 -0
  236. package/test/spec/activities/rules_spec.js +135 -0
  237. package/test/spec/modules/1plusXRtdProvider_spec.js +98 -149
  238. package/test/spec/modules/adagioBidAdapter_spec.js +46 -17
  239. package/test/spec/modules/adgenerationBidAdapter_spec.js +52 -12
  240. package/test/spec/modules/airgridRtdProvider_spec.js +2 -0
  241. package/test/spec/modules/beopBidAdapter_spec.js +24 -0
  242. package/test/spec/modules/conceptxBidAdapter_spec.js +136 -0
  243. package/test/spec/modules/connectIdSystem_spec.js +291 -23
  244. package/test/spec/modules/criteoBidAdapter_spec.js +85 -1
  245. package/test/spec/modules/eids_spec.js +15 -0
  246. package/test/spec/modules/eskimiBidAdapter_spec.js +264 -112
  247. package/test/spec/modules/euidIdSystem_spec.js +130 -0
  248. package/test/spec/modules/freepassIdSystem_spec.js +186 -0
  249. package/test/spec/modules/gdprEnforcement_spec.js +127 -414
  250. package/test/spec/modules/growthCodeRtdProvider_spec.js +127 -0
  251. package/test/spec/modules/id5IdSystem_spec.js +10 -3
  252. package/test/spec/modules/ixBidAdapter_spec.js +32 -1
  253. package/test/spec/modules/logicadBidAdapter_spec.js +122 -2
  254. package/test/spec/modules/mediasquareBidAdapter_spec.js +4 -0
  255. package/test/spec/modules/oxxionAnalyticsAdapter_spec.js +324 -0
  256. package/test/spec/modules/pairIdSystem_spec.js +16 -3
  257. package/test/spec/modules/realTimeDataModule_spec.js +1 -1
  258. package/test/spec/modules/richaudienceBidAdapter_spec.js +44 -0
  259. package/test/spec/modules/schain_spec.js +9 -0
  260. package/test/spec/modules/sharethroughBidAdapter_spec.js +1 -1
  261. package/test/spec/modules/sirdataRtdProvider_spec.js +110 -17
  262. package/test/spec/modules/smartadserverBidAdapter_spec.js +42 -0
  263. package/test/spec/modules/sovrnBidAdapter_spec.js +13 -0
  264. package/test/spec/modules/stroeerCoreBidAdapter_spec.js +151 -6
  265. package/test/spec/modules/stvBidAdapter_spec.js +13 -1
  266. package/test/spec/modules/uid2IdSystem_helpers.js +70 -0
  267. package/test/spec/modules/uid2IdSystem_spec.js +131 -86
  268. package/test/spec/modules/undertoneBidAdapter_spec.js +57 -1
  269. package/test/spec/modules/userId_spec.js +96 -33
  270. package/test/spec/modules/weboramaRtdProvider_spec.js +331 -205
  271. package/test/spec/modules/yahoosspBidAdapter_spec.js +103 -51
  272. package/test/spec/modules/yieldlabBidAdapter_spec.js +42 -2
  273. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +204 -4
  274. package/test/spec/unit/core/adapterManager_spec.js +181 -1
  275. package/test/spec/unit/core/storageManager_spec.js +76 -68
  276. package/test/spec/unit/pbjs_api_spec.js +15 -25
  277. package/test/spec/userSync_spec.js +45 -16
@@ -4,7 +4,7 @@ import adapterManager, {
4
4
  coppaDataHandler,
5
5
  _partitionBidders,
6
6
  PARTITIONS,
7
- getS2SBidderSet, _filterBidsForAdUnit
7
+ getS2SBidderSet, _filterBidsForAdUnit, dep
8
8
  } from 'src/adapterManager.js';
9
9
  import {
10
10
  getAdUnits,
@@ -23,6 +23,7 @@ import {hook} from '../../../../src/hook.js';
23
23
  import {auctionManager} from '../../../../src/auctionManager.js';
24
24
  import {GDPR_GVLIDS} from '../../../../src/consentHandler.js';
25
25
  import {MODULE_TYPE_ANALYTICS, MODULE_TYPE_BIDDER} from '../../../../src/activities/modules.js';
26
+ import {ACTIVITY_FETCH_BIDS, ACTIVITY_REPORT_ANALYTICS} from '../../../../src/activities/activities.js';
26
27
  var events = require('../../../../src/events');
27
28
 
28
29
  const CONFIG = {
@@ -1721,6 +1722,129 @@ describe('adapterManager tests', function () {
1721
1722
  expect(sizes1).not.to.deep.equal(sizes2);
1722
1723
  });
1723
1724
 
1725
+ describe('and activity controls', () => {
1726
+ let redactOrtb2;
1727
+ let redactBidRequest;
1728
+ const MOCK_BIDDERS = ['1', '2', '3', '4', '5'].map((n) => `mockBidder${n}`);
1729
+
1730
+ beforeEach(() => {
1731
+ sinon.stub(dep, 'isAllowed');
1732
+ redactOrtb2 = sinon.stub().callsFake(ob => ob);
1733
+ redactBidRequest = sinon.stub().callsFake(ob => ob);
1734
+ sinon.stub(dep, 'redact').callsFake(() => ({
1735
+ ortb2: redactOrtb2,
1736
+ bidRequest: redactBidRequest
1737
+ }))
1738
+ MOCK_BIDDERS.forEach((bidder) => adapterManager.bidderRegistry[bidder] = {});
1739
+ });
1740
+ afterEach(() => {
1741
+ dep.isAllowed.restore();
1742
+ dep.redact.restore();
1743
+ MOCK_BIDDERS.forEach(bidder => { delete adapterManager.bidderRegistry[bidder] });
1744
+ config.resetConfig();
1745
+ })
1746
+ it('should not generate requests for bidders that cannot fetchBids', () => {
1747
+ adUnits = [
1748
+ {code: 'one', bids: ['mockBidder1', 'mockBidder2', 'mockBidder3'].map((bidder) => ({bidder}))},
1749
+ {code: 'two', bids: ['mockBidder4', 'mockBidder5', 'mockBidder4'].map((bidder) => ({bidder}))}
1750
+ ];
1751
+ const allowed = ['mockBidder2', 'mockBidder5'];
1752
+ dep.isAllowed.callsFake((activity, {componentType, componentName}) => {
1753
+ return activity === ACTIVITY_FETCH_BIDS &&
1754
+ componentType === MODULE_TYPE_BIDDER &&
1755
+ allowed.includes(componentName);
1756
+ });
1757
+ let reqs = adapterManager.makeBidRequests(
1758
+ adUnits,
1759
+ Date.now(),
1760
+ utils.getUniqueIdentifierStr(),
1761
+ function callback() {},
1762
+ []
1763
+ );
1764
+ const bidders = Array.from(new Set(reqs.flatMap(br => br.bids).map(bid => bid.bidder)).keys());
1765
+ expect(bidders).to.have.members(allowed);
1766
+ });
1767
+
1768
+ it('should redact ortb2 and bid request objects', () => {
1769
+ dep.isAllowed.callsFake(() => true);
1770
+ adUnits = [
1771
+ {code: 'one', bids: [{bidder: 'mockBidder1'}]}
1772
+ ];
1773
+ let reqs = adapterManager.makeBidRequests(
1774
+ adUnits,
1775
+ Date.now(),
1776
+ utils.getUniqueIdentifierStr(),
1777
+ function callback() {},
1778
+ []
1779
+ );
1780
+ sinon.assert.calledWith(redactBidRequest, reqs[0].bids[0]);
1781
+ sinon.assert.calledWith(redactOrtb2, reqs[0].ortb2);
1782
+ })
1783
+
1784
+ describe('with multiple s2s configs', () => {
1785
+ beforeEach(() => {
1786
+ config.setConfig({
1787
+ s2sConfig: [
1788
+ {
1789
+ enabled: true,
1790
+ adapter: 'mockS2SDefault',
1791
+ bidders: ['mockBidder1']
1792
+ },
1793
+ {
1794
+ enabled: true,
1795
+ adapter: 'mockS2S1',
1796
+ configName: 'mock1',
1797
+ },
1798
+ {
1799
+ enabled: true,
1800
+ adapter: 'mockS2S2',
1801
+ configName: 'mock2',
1802
+ }
1803
+ ]
1804
+ });
1805
+ });
1806
+ it('should keep stored impressions, even if everything else is denied', () => {
1807
+ adUnits = [
1808
+ {code: 'one', bids: [{bidder: null}]},
1809
+ {code: 'two', bids: [{module: 'pbsBidAdapter', params: {configName: 'mock1'}}, {module: 'pbsBidAdapter', params: {configName: 'mock2'}}]}
1810
+ ]
1811
+ dep.isAllowed.callsFake(({componentType}) => componentType !== 'bidder');
1812
+ let bidRequests = adapterManager.makeBidRequests(
1813
+ adUnits,
1814
+ Date.now(),
1815
+ utils.getUniqueIdentifierStr(),
1816
+ function callback() {},
1817
+ []
1818
+ );
1819
+ expect(new Set(bidRequests.map(br => br.uniquePbsTid)).size).to.equal(3);
1820
+ });
1821
+
1822
+ it('should check if the s2s adapter itself is allowed to fetch bids', () => {
1823
+ adUnits = [
1824
+ {
1825
+ code: 'au',
1826
+ bids: [
1827
+ {bidder: null},
1828
+ {module: 'pbsBidAdapter', params: {configName: 'mock1'}},
1829
+ {module: 'pbsBidAdapter', params: {configName: 'mock2'}},
1830
+ {bidder: 'mockBidder1'}
1831
+ ]
1832
+ }
1833
+ ];
1834
+ dep.isAllowed.callsFake((_, {configName, componentName}) => !(componentName === 'pbsBidAdapter' && configName === 'mock1'));
1835
+ let bidRequests = adapterManager.makeBidRequests(
1836
+ adUnits,
1837
+ Date.now(),
1838
+ utils.getUniqueIdentifierStr(),
1839
+ function callback() {
1840
+ },
1841
+ []
1842
+ );
1843
+ expect(new Set(bidRequests.map(br => br.uniquePbsTid)).size).to.eql(2)
1844
+ });
1845
+ });
1846
+ });
1847
+
1724
1848
  it('should make FPD available under `ortb2`', () => {
1725
1849
  const global = {
1726
1850
  k1: 'v1',
@@ -2692,12 +2816,29 @@ describe('adapterManager tests', function () {
2692
2816
 
2693
2817
  beforeEach(() => {
2694
2818
  bidderRequests = [];
2819
+ ['mockBidder', 'mockBidder1', 'mockBidder2'].forEach(bidder => {
2820
+ adapterManager.registerBidAdapter({callBids: sinon.stub(), getSpec: () => ({code: bidder})}, bidder);
2821
+ })
2695
2822
  sinon.stub(auctionManager, 'getBidsRequested').callsFake(() => bidderRequests);
2696
2823
  })
2697
2824
  afterEach(() => {
2698
2825
  auctionManager.getBidsRequested.restore();
2699
2826
  })
2700
2827
 
2828
+ it('can resolve aliases', () => {
2829
+ adapterManager.aliasBidAdapter('mockBidder', 'mockBidderAlias');
2830
+ expect(adapterManager.resolveAlias('mockBidderAlias')).to.eql('mockBidder');
2831
+ });
2832
+ it('does not stuck in alias cycles', () => {
2833
+ adapterManager.aliasRegistry['alias1'] = 'alias2';
2834
+ adapterManager.aliasRegistry['alias2'] = 'alias2';
2835
+ expect(adapterManager.resolveAlias('alias2')).to.eql('alias2');
2836
+ })
2837
+ it('returns self when not an alias', () => {
2838
+ delete adapterManager.aliasRegistry['missing'];
2839
+ expect(adapterManager.resolveAlias('missing')).to.eql('missing');
2840
+ })
2841
+
2701
2842
  it('does not invoke onDataDeletionRequest on aliases', () => {
2702
2843
  const del = delMethodForBidder('mockBidder');
2703
2844
  adapterManager.aliasBidAdapter('mockBidder', 'mockBidderAlias');
@@ -2740,6 +2881,45 @@ describe('adapterManager tests', function () {
2740
2881
  })
2741
2882
  });
2742
2883
 
2884
+ describe('reportAnalytics check', () => {
2885
+ beforeEach(() => {
2886
+ sinon.stub(dep, 'isAllowed');
2887
+ });
2888
+ afterEach(() => {
2889
+ dep.isAllowed.restore();
2890
+ });
2891
+
2892
+ it('should check for reportAnalytics before registering analytics adapter', () => {
2893
+ const enabled = {};
2894
+ ['mockAnalytics1', 'mockAnalytics2'].forEach((code) => {
2895
+ adapterManager.registerAnalyticsAdapter({
2896
+ code,
2897
+ adapter: {
2898
+ enableAnalytics: sinon.stub().callsFake(() => { enabled[code] = true })
2899
+ }
2900
+ })
2901
+ })
2902
+
2903
+ const anlCfg = [
2904
+ {
2905
+ provider: 'mockAnalytics1',
2906
+ random: 'values'
2907
+ },
2908
+ {
2909
+ provider: 'mockAnalytics2'
2910
+ }
2911
+ ]
2912
+ dep.isAllowed.callsFake((activity, {component, _config}) => {
2913
+ return activity === ACTIVITY_REPORT_ANALYTICS &&
2914
+ component === `${MODULE_TYPE_ANALYTICS}.${anlCfg[0].provider}` &&
2915
+ _config === anlCfg[0]
2916
+ })
2917
+
2918
+ adapterManager.enableAnalytics(anlCfg);
2919
+ expect(enabled).to.eql({mockAnalytics1: true});
2920
+ });
2921
+ });
2922
+
2743
2923
  describe('registers GVL IDs', () => {
2744
2924
  beforeEach(() => {
2745
2925
  sinon.stub(GDPR_GVLIDS, 'register');
@@ -1,14 +1,25 @@
1
1
  import {
2
- getCoreStorageManager, getStorageManager,
2
+ deviceAccessRule,
3
+ getCoreStorageManager,
3
4
  newStorageManager,
4
5
  resetData,
6
+ STORAGE_TYPE_COOKIES,
7
+ STORAGE_TYPE_LOCALSTORAGE,
8
+ storageAllowedRule,
5
9
  storageCallbacks,
6
- validateStorageEnforcement
7
10
  } from 'src/storageManager.js';
11
+ import adapterManager from 'src/adapterManager.js';
8
12
  import {config} from 'src/config.js';
9
13
  import * as utils from 'src/utils.js';
10
14
  import {hook} from '../../../../src/hook.js';
11
- import {MODULE_TYPE_BIDDER} from '../../../../src/activities/modules.js';
15
+ import {MODULE_TYPE_BIDDER, MODULE_TYPE_PREBID} from '../../../../src/activities/modules.js';
16
+ import {ACTIVITY_ACCESS_DEVICE} from '../../../../src/activities/activities.js';
17
+ import {
18
+ ACTIVITY_PARAM_COMPONENT_NAME,
19
+ ACTIVITY_PARAM_COMPONENT_TYPE,
20
+ ACTIVITY_PARAM_STORAGE_TYPE
21
+ } from '../../../../src/activities/params.js';
22
+ import {activityParams} from '../../../../src/activities/activityParams.js';
12
23
 
13
24
  describe('storage manager', function() {
14
25
  before(() => {
@@ -56,41 +67,42 @@ describe('storage manager', function() {
56
67
  deviceAccessSpy.restore();
57
68
  });
58
69
 
59
- describe(`enforcement`, () => {
60
- let validateHook;
70
+ describe(`accessDevice activity check`, () => {
71
+ let isAllowed;
72
+
73
+ function mkManager(moduleType, moduleName) {
74
+ return newStorageManager({moduleType, moduleName}, {isAllowed});
75
+ }
61
76
 
62
77
  beforeEach(() => {
63
- validateHook = sinon.stub().callsFake(function (next, ...args) {
64
- next.apply(this, args);
65
- });
66
- validateStorageEnforcement.before(validateHook, 99);
78
+ isAllowed = sinon.stub();
67
79
  });
68
80
 
69
- afterEach(() => {
70
- validateStorageEnforcement.getHooks({hook: validateHook}).remove();
71
- config.resetConfig();
72
- })
73
-
74
- Object.entries({
75
- 'core': () => getCoreStorageManager('mock'),
76
- 'other': () => getStorageManager({moduleType: 'other', moduleName: 'mock'})
77
- }).forEach(([moduleType, getMgr]) => {
78
- describe(`for ${moduleType} modules`, () => {
79
- let storage;
80
- beforeEach(() => {
81
- storage = getMgr();
82
- });
83
- it(`should pass '${moduleType}' module type to consent enforcement`, () => {
84
- storage.localStorageIsEnabled();
85
- expect(validateHook.args[0][1]).to.equal(moduleType);
86
- });
81
+ it('should pass module type and name as activity params', () => {
82
+ mkManager(MODULE_TYPE_PREBID, 'mockMod').localStorageIsEnabled();
83
+ sinon.assert.calledWith(isAllowed, ACTIVITY_ACCESS_DEVICE, sinon.match({
84
+ [ACTIVITY_PARAM_COMPONENT_TYPE]: MODULE_TYPE_PREBID,
85
+ [ACTIVITY_PARAM_COMPONENT_NAME]: 'mockMod',
86
+ [ACTIVITY_PARAM_STORAGE_TYPE]: STORAGE_TYPE_LOCALSTORAGE
87
+ }));
88
+ });
87
89
 
88
- it('should respect the deviceAccess flag', () => {
89
- config.setConfig({deviceAccess: false});
90
- expect(storage.localStorageIsEnabled()).to.be.false
91
- });
92
- });
90
+ it('should deny access if activity is denied', () => {
91
+ isAllowed.returns(false);
92
+ const mgr = mkManager(MODULE_TYPE_PREBID, 'mockMod');
93
+ mgr.setDataInLocalStorage('testKey', 'val');
94
+ expect(mgr.getDataFromLocalStorage('testKey')).to.not.exist;
93
95
  });
96
+
97
+ it('should use bidder aliases when possible', () => {
98
+ adapterManager.registerBidAdapter({callBids: sinon.stub(), getSpec: () => ({})}, 'mockBidder');
99
+ adapterManager.aliasBidAdapter('mockBidder', 'mockAlias');
100
+ const mgr = mkManager(MODULE_TYPE_BIDDER, 'mockBidder');
101
+ config.runWithBidder('mockAlias', () => mgr.cookiesAreEnabled());
102
+ sinon.assert.calledWith(isAllowed, ACTIVITY_ACCESS_DEVICE, sinon.match({
103
+ [ACTIVITY_PARAM_COMPONENT_NAME]: 'mockAlias'
104
+ }))
105
+ })
94
106
  })
95
107
 
96
108
  describe('localstorage forbidden access in 3rd-party context', function() {
@@ -145,13 +157,26 @@ describe('storage manager', function() {
145
157
  });
146
158
  });
147
159
 
148
- describe('when bidderSettings.allowStorage is defined', () => {
160
+ describe('deviceAccess control', () => {
161
+ afterEach(() => {
162
+ config.resetConfig()
163
+ });
164
+
165
+ it('should allow by default', () => {
166
+ config.resetConfig();
167
+ expect(deviceAccessRule()).to.not.exist;
168
+ });
169
+
170
+ it('should deny access when set', () => {
171
+ config.setConfig({deviceAccess: false});
172
+ sinon.assert.match(deviceAccessRule(), {allow: false});
173
+ })
174
+ });
175
+
176
+ describe('allowStorage access control rule', () => {
149
177
  const ALLOWED_BIDDER = 'allowed-bidder';
150
178
  const ALLOW_KEY = 'storageAllowed';
151
179
 
152
- const COOKIE = 'test-cookie';
153
- const LS_KEY = 'test-localstorage';
154
-
155
180
  function mockBidderSettings(val) {
156
181
  return {
157
182
  get(bidder, key) {
@@ -213,39 +238,22 @@ describe('storage manager', function() {
213
238
  }).forEach(([t, {configValues, shouldWork: {cookie, html5}}]) => {
214
239
  describe(`when ${t} is allowed`, () => {
215
240
  configValues.forEach(configValue => describe(`storageAllowed = ${configValue}`, () => {
216
- let mgr;
217
-
218
- beforeEach(() => {
219
- mgr = newStorageManager({moduleType: MODULE_TYPE_BIDDER, moduleName: bidderCode}, {bidderSettings: mockBidderSettings(configValue)});
220
- })
221
-
222
- afterEach(() => {
223
- mgr.setCookie(COOKIE, 'delete', new Date().toUTCString());
224
- mgr.removeDataFromLocalStorage(LS_KEY);
225
- })
226
-
227
- function scenario(type, desc, fn) {
241
+ Object.entries({
242
+ [STORAGE_TYPE_LOCALSTORAGE]: 'allow localStorage',
243
+ [STORAGE_TYPE_COOKIES]: 'allow cookies'
244
+ }).forEach(([type, desc]) => {
228
245
  const shouldWork = isBidderAllowed && ({html5, cookie})[type];
229
- it(`${shouldWork ? '' : 'NOT'} ${desc}`, () => fn(shouldWork));
230
- }
231
-
232
- scenario('cookie', 'allow cookies', (shouldWork) => {
233
- mgr.setCookie(COOKIE, 'value');
234
- expect(mgr.getCookie(COOKIE)).to.equal(shouldWork ? 'value' : null);
235
- });
236
-
237
- scenario('html5', 'allow localStorage', (shouldWork) => {
238
- mgr.setDataInLocalStorage(LS_KEY, 'value');
239
- expect(mgr.getDataFromLocalStorage(LS_KEY)).to.equal(shouldWork ? 'value' : null);
240
- });
241
-
242
- scenario('html5', 'report localStorage as available', (shouldWork) => {
243
- expect(mgr.hasLocalStorage()).to.equal(shouldWork);
244
- });
245
-
246
- scenario('cookie', 'report cookies as available', (shouldWork) => {
247
- expect(mgr.cookiesAreEnabled()).to.equal(shouldWork);
248
- });
246
+ it(`${shouldWork ? '' : 'NOT'} ${desc}`, () => {
247
+ const res = storageAllowedRule(activityParams(MODULE_TYPE_BIDDER, bidderCode, {
248
+ [ACTIVITY_PARAM_STORAGE_TYPE]: type
249
+ }), mockBidderSettings(configValue));
250
+ if (shouldWork) {
251
+ expect(res).to.not.exist;
252
+ } else {
253
+ sinon.assert.match(res, {allow: false});
254
+ }
255
+ });
256
+ })
249
257
  }));
250
258
  });
251
259
  });
@@ -25,6 +25,7 @@ import {stubAuctionIndex} from '../../helpers/indexStub.js';
25
25
  import {createBid} from '../../../src/bidfactory.js';
26
26
  import {enrichFPD} from '../../../src/fpd/enrichment.js';
27
27
  import {mockFpdEnrichments} from '../../helpers/fpd.js';
28
+
28
29
  var assert = require('chai').assert;
29
30
  var expect = require('chai').expect;
30
31
 
@@ -3349,66 +3350,55 @@ describe('Unit: Prebid Module', function () {
3349
3350
 
3350
3351
  if (FEATURES.VIDEO) {
3351
3352
  describe('markWinningBidAsUsed', function () {
3352
- it('marks the bid object as used for the given adUnitCode/adId combination', function () {
3353
- // make sure the auction has "state" and does not reload the fixtures
3354
- const adUnitCode = '/19968336/header-bid-tag-0';
3353
+ const adUnitCode = '/19968336/header-bid-tag-0';
3354
+ let winningBid;
3355
+
3356
+ beforeEach(() => {
3355
3357
  const bidsReceived = $$PREBID_GLOBAL$$.getBidResponsesForAdUnitCode(adUnitCode);
3356
3358
  auction.getBidsReceived = function() { return bidsReceived.bids };
3357
3359
 
3358
3360
  // mark the bid and verify the state has changed to RENDERED
3359
- const winningBid = targeting.getWinningBids(adUnitCode)[0];
3361
+ winningBid = targeting.getWinningBids(adUnitCode)[0];
3362
+ auction.getAuctionId = function() { return winningBid.auctionId };
3363
+ })
3364
+
3365
+ afterEach(() => {
3366
+ resetAuction();
3367
+ })
3368
+
3369
+ it('marks the bid object as used for the given adUnitCode/adId combination', function () {
3370
+ // make sure the auction has "state" and does not reload the fixtures
3360
3371
  $$PREBID_GLOBAL$$.markWinningBidAsUsed({ adUnitCode, adId: winningBid.adId });
3361
3372
  const markedBid = find($$PREBID_GLOBAL$$.getBidResponsesForAdUnitCode(adUnitCode).bids,
3362
3373
  bid => bid.adId === winningBid.adId);
3363
3374
 
3364
3375
  expect(markedBid.status).to.equal(CONSTANTS.BID_STATUS.RENDERED);
3365
- resetAuction();
3366
3376
  });
3367
3377
 
3368
3378
  it('try and mark the bid object, but fail because we supplied the wrong adId', function () {
3369
- const adUnitCode = '/19968336/header-bid-tag-0';
3370
- const bidsReceived = $$PREBID_GLOBAL$$.getBidResponsesForAdUnitCode(adUnitCode);
3371
- auction.getBidsReceived = function() { return bidsReceived.bids };
3372
-
3373
- const winningBid = targeting.getWinningBids(adUnitCode)[0];
3374
3379
  $$PREBID_GLOBAL$$.markWinningBidAsUsed({ adUnitCode, adId: 'miss' });
3375
3380
  const markedBid = find($$PREBID_GLOBAL$$.getBidResponsesForAdUnitCode(adUnitCode).bids,
3376
3381
  bid => bid.adId === winningBid.adId);
3377
3382
 
3378
3383
  expect(markedBid.status).to.not.equal(CONSTANTS.BID_STATUS.RENDERED);
3379
- resetAuction();
3380
3384
  });
3381
3385
 
3382
3386
  it('marks the winning bid object as used for the given adUnitCode', function () {
3383
3387
  // make sure the auction has "state" and does not reload the fixtures
3384
- const adUnitCode = '/19968336/header-bid-tag-0';
3385
- const bidsReceived = $$PREBID_GLOBAL$$.getBidResponsesForAdUnitCode(adUnitCode);
3386
- auction.getBidsReceived = function() { return bidsReceived.bids };
3387
-
3388
- // mark the bid and verify the state has changed to RENDERED
3389
- const winningBid = targeting.getWinningBids(adUnitCode)[0];
3390
3388
  $$PREBID_GLOBAL$$.markWinningBidAsUsed({ adUnitCode });
3391
3389
  const markedBid = find($$PREBID_GLOBAL$$.getBidResponsesForAdUnitCode(adUnitCode).bids,
3392
3390
  bid => bid.adId === winningBid.adId);
3393
3391
 
3394
3392
  expect(markedBid.status).to.equal(CONSTANTS.BID_STATUS.RENDERED);
3395
- resetAuction();
3396
3393
  });
3397
3394
 
3398
3395
  it('marks a bid object as used for the given adId', function () {
3399
3396
  // make sure the auction has "state" and does not reload the fixtures
3400
- const adUnitCode = '/19968336/header-bid-tag-0';
3401
- const bidsReceived = $$PREBID_GLOBAL$$.getBidResponsesForAdUnitCode(adUnitCode);
3402
- auction.getBidsReceived = function() { return bidsReceived.bids };
3403
-
3404
- // mark the bid and verify the state has changed to RENDERED
3405
- const winningBid = targeting.getWinningBids(adUnitCode)[0];
3406
3397
  $$PREBID_GLOBAL$$.markWinningBidAsUsed({ adId: winningBid.adId });
3407
3398
  const markedBid = find($$PREBID_GLOBAL$$.getBidResponsesForAdUnitCode(adUnitCode).bids,
3408
3399
  bid => bid.adId === winningBid.adId);
3409
3400
 
3410
3401
  expect(markedBid.status).to.equal(CONSTANTS.BID_STATUS.RENDERED);
3411
- resetAuction();
3412
3402
  });
3413
3403
  });
3414
3404
  }
@@ -1,5 +1,13 @@
1
1
  import { expect } from 'chai';
2
2
  import { config } from 'src/config.js';
3
+ import {ruleRegistry} from '../../src/activities/rules.js';
4
+ import {ACTIVITY_SYNC_USER} from '../../src/activities/activities.js';
5
+ import {
6
+ ACTIVITY_PARAM_COMPONENT,
7
+ ACTIVITY_PARAM_SYNC_TYPE,
8
+ ACTIVITY_PARAM_SYNC_URL
9
+ } from '../../src/activities/params.js';
10
+ import {MODULE_TYPE_BIDDER} from '../../src/activities/modules.js';
3
11
  // Use require since we need to be able to write to these vars
4
12
  const utils = require('../../src/utils');
5
13
  let { newUserSync, USERSYNC_DEFAULT_CONFIG } = require('../../src/userSync');
@@ -14,12 +22,18 @@ describe('user sync', function () {
14
22
  let idPrefix = 'test-generated-id-';
15
23
  let lastId = 0;
16
24
  let defaultUserSyncConfig = config.getConfig('userSync');
17
- function getUserSyncConfig(userSyncConfig) {
18
- return Object.assign({}, defaultUserSyncConfig, userSyncConfig);
25
+ let regRule, isAllowed;
26
+
27
+ function mkUserSync(deps) {
28
+ [regRule, isAllowed] = ruleRegistry();
29
+ return newUserSync(Object.assign({
30
+ regRule, isAllowed
31
+ }, deps))
19
32
  }
33
+
20
34
  function newTestUserSync(configOverrides, disableBrowserCookies) {
21
35
  const thisConfig = Object.assign({}, defaultUserSyncConfig, configOverrides);
22
- return newUserSync({
36
+ return mkUserSync({
23
37
  config: thisConfig,
24
38
  browserSupportsCookies: !disableBrowserCookies,
25
39
  })
@@ -59,6 +73,22 @@ describe('user sync', function () {
59
73
  expect(triggerPixelStub.getCall(0).args[0]).to.exist.and.to.equal('http://example.com');
60
74
  });
61
75
 
76
+ it('should NOT fire a sync if a rule blocks syncUser', () => {
77
+ const userSync = newTestUserSync()
78
+ regRule(ACTIVITY_SYNC_USER, 'testRule', (params) => {
79
+ if (
80
+ params[ACTIVITY_PARAM_COMPONENT] === `${MODULE_TYPE_BIDDER}.testBidder` &&
81
+ params[ACTIVITY_PARAM_SYNC_TYPE] === 'image' &&
82
+ params[ACTIVITY_PARAM_SYNC_URL] === 'http://example.com'
83
+ ) {
84
+ return {allow: false}
85
+ }
86
+ })
87
+ userSync.registerSync('image', 'testBidder', 'http://example.com');
88
+ userSync.syncUsers();
89
+ expect(triggerPixelStub.called).to.be.false;
90
+ })
91
+
62
92
  it('should clear queue after sync', function () {
63
93
  const userSync = newTestUserSync();
64
94
  userSync.syncUsers();
@@ -371,14 +401,13 @@ describe('user sync', function () {
371
401
  userSync.registerSync('image', 'atestBidder', 'http://example.com/1');
372
402
  userSync.registerSync('iframe', 'testBidder', 'http://example.com/iframe');
373
403
  userSync.syncUsers();
374
- expect(logWarnStub.getCall(0).args[0]).to.exist;
375
404
  expect(triggerPixelStub.getCall(0)).to.not.be.null;
376
405
  expect(triggerPixelStub.getCall(0).args[0]).to.exist.and.to.equal('http://example.com/1');
377
406
  expect(insertUserSyncIframeStub.getCall(0)).to.be.null;
378
407
  });
379
408
 
380
409
  it('should still allow default image syncs if setConfig only defined iframe', function () {
381
- const userSync = newUserSync({
410
+ const userSync = mkUserSync({
382
411
  config: config.getConfig('userSync'),
383
412
  browserSupportsCookies: true
384
413
  });
@@ -403,7 +432,7 @@ describe('user sync', function () {
403
432
  });
404
433
 
405
434
  it('should not fire image pixel for a bidder if iframe pixel is fired for same bidder', function() {
406
- const userSync = newUserSync({
435
+ const userSync = mkUserSync({
407
436
  config: config.getConfig('userSync'),
408
437
  browserSupportsCookies: true
409
438
  });
@@ -430,7 +459,7 @@ describe('user sync', function () {
430
459
  });
431
460
 
432
461
  it('should override default image syncs if setConfig used image filter', function () {
433
- const userSync = newUserSync({
462
+ const userSync = mkUserSync({
434
463
  config: config.getConfig('userSync'),
435
464
  browserSupportsCookies: true
436
465
  });
@@ -455,7 +484,7 @@ describe('user sync', function () {
455
484
  });
456
485
 
457
486
  it('should override default image syncs if setConfig used all filter', function() {
458
- const userSync = newUserSync({
487
+ const userSync = mkUserSync({
459
488
  config: config.getConfig('userSync'),
460
489
  browserSupportsCookies: true
461
490
  });
@@ -488,7 +517,7 @@ describe('user sync', function () {
488
517
  describe('canBidderRegisterSync', function () {
489
518
  describe('with filterSettings', function () {
490
519
  it('should return false if filter settings does not allow it', function () {
491
- const userSync = newUserSync({
520
+ const userSync = mkUserSync({
492
521
  config: {
493
522
  filterSettings: {
494
523
  image: {
@@ -505,7 +534,7 @@ describe('user sync', function () {
505
534
  expect(userSync.canBidderRegisterSync('iframe', 'otherTestBidder')).to.equal(false);
506
535
  });
507
536
  it('should return false for iframe if there is no iframe filterSettings', function () {
508
- const userSync = newUserSync({
537
+ const userSync = mkUserSync({
509
538
  config: {
510
539
  syncEnabled: true,
511
540
  filterSettings: {
@@ -523,7 +552,7 @@ describe('user sync', function () {
523
552
  expect(userSync.canBidderRegisterSync('iframe', 'otherTestBidder')).to.equal(false);
524
553
  });
525
554
  it('should return true if filter settings does allow it', function () {
526
- const userSync = newUserSync({
555
+ const userSync = mkUserSync({
527
556
  config: {
528
557
  filterSettings: {
529
558
  image: {
@@ -543,7 +572,7 @@ describe('user sync', function () {
543
572
  describe('almost deprecated - without filterSettings', function () {
544
573
  describe('enabledBidders contains testBidder', function () {
545
574
  it('should return false if type is iframe and iframeEnabled is false', function () {
546
- const userSync = newUserSync({
575
+ const userSync = mkUserSync({
547
576
  config: {
548
577
  filterSettings: {
549
578
  iframe: {
@@ -557,7 +586,7 @@ describe('user sync', function () {
557
586
  });
558
587
 
559
588
  it('should return true if type is iframe and iframeEnabled is true', function () {
560
- const userSync = newUserSync({
589
+ const userSync = mkUserSync({
561
590
  config: {
562
591
  pixelEnabled: true,
563
592
  iframeEnabled: true,
@@ -568,7 +597,7 @@ describe('user sync', function () {
568
597
  });
569
598
 
570
599
  it('should return false if type is image and pixelEnabled is false', function () {
571
- const userSync = newUserSync({
600
+ const userSync = mkUserSync({
572
601
  config: {
573
602
  filterSettings: {
574
603
  image: {
@@ -582,7 +611,7 @@ describe('user sync', function () {
582
611
  });
583
612
 
584
613
  it('should return true if type is image and pixelEnabled is true', function () {
585
- const userSync = newUserSync({
614
+ const userSync = mkUserSync({
586
615
  config: {
587
616
  pixelEnabled: true,
588
617
  iframeEnabled: true,
@@ -595,7 +624,7 @@ describe('user sync', function () {
595
624
 
596
625
  describe('enabledBidders does not container testBidder', function () {
597
626
  it('should return false since testBidder is not in enabledBidders', function () {
598
- const userSync = newUserSync({
627
+ const userSync = mkUserSync({
599
628
  config: {
600
629
  filterSettings: {
601
630
  image: {