From 920e7ab16a12d610f074d1a4ba1df5bca3f5d6da Mon Sep 17 00:00:00 2001 From: Anthony Lin Date: Thu, 22 Jun 2023 09:01:38 -0400 Subject: [PATCH 1/3] coppa support --- modules/33acrossBidAdapter.js | 6 +++ modules/33acrossIdSystem.js | 6 ++- test/spec/modules/33acrossBidAdapter_spec.js | 33 +++++++++++++++ test/spec/modules/33acrossIdSystem_spec.js | 44 +++++++++++++++++++- 4 files changed, 86 insertions(+), 3 deletions(-) diff --git a/modules/33acrossBidAdapter.js b/modules/33acrossBidAdapter.js index 26fc0a11fd5..306586a2d59 100644 --- a/modules/33acrossBidAdapter.js +++ b/modules/33acrossBidAdapter.js @@ -296,6 +296,12 @@ function _createServerRequest({ bidRequests, gdprConsent = {}, uspConsent, pageU }); } + const coppaValue = config.getConfig('coppa'); + + if (coppaValue) { + ttxRequest.regs.coppa = (coppaValue === true || coppaValue === 1) ? 1 : 0; + } + ttxRequest.ext = { ttx: { prebidStartedAt: Date.now(), diff --git a/modules/33acrossIdSystem.js b/modules/33acrossIdSystem.js index be81b26b110..802c2651d29 100644 --- a/modules/33acrossIdSystem.js +++ b/modules/33acrossIdSystem.js @@ -8,7 +8,7 @@ import { logMessage, logError } from '../src/utils.js'; import { ajaxBuilder } from '../src/ajax.js'; import { submodule } from '../src/hook.js'; -import { uspDataHandler } from '../src/adapterManager.js'; +import { uspDataHandler, coppaDataHandler } from '../src/adapterManager.js'; const MODULE_NAME = '33acrossId'; const API_URL = 'https://lexicon.33across.com/v1/envelope'; @@ -37,11 +37,13 @@ function getEnvelope(response) { function calculateQueryStringParams(pid, gdprConsentData) { const uspString = uspDataHandler.getConsentData(); const gdprApplies = Boolean(gdprConsentData?.gdprApplies); + const coppaValue = coppaDataHandler.getCoppa(); const params = { pid, gdpr: Number(gdprApplies), src: CALLER_NAME, - ver: '$prebid.version$' + ver: '$prebid.version$', + coppa: Number(coppaValue) }; if (uspString) { diff --git a/test/spec/modules/33acrossBidAdapter_spec.js b/test/spec/modules/33acrossBidAdapter_spec.js index aa2621f1fa0..9fed319911f 100644 --- a/test/spec/modules/33acrossBidAdapter_spec.js +++ b/test/spec/modules/33acrossBidAdapter_spec.js @@ -200,6 +200,14 @@ describe('33acrossBidAdapter:', function () { return this; }; + this.withCoppa = coppaValue => { + Object.assign(ttxRequest.regs, { + coppa: coppaValue + }); + + return this; + }; + this.withSite = site => { Object.assign(ttxRequest, { site }); return this; @@ -1059,6 +1067,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withGdprConsent('foobarMyPreference', 1) + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1094,6 +1103,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct() + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1138,6 +1148,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withUspConsent('foo') + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1173,6 +1184,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct() + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1184,6 +1196,24 @@ describe('33acrossBidAdapter:', function () { }); }); + context('when coppa config exists', function() { + it('returns corresponding server requests with coppa data', function() { + sandbox.stub(config, 'getConfig').withArgs('coppa').returns(true); + + const ttxRequest = new TtxRequestBuilder() + .withBanner() + .withProduct() + .withCoppa(1) + .build(); + const serverRequest = new ServerRequestBuilder() + .withData(ttxRequest) + .build(); + const [ builtServerRequest ] = spec.buildRequests(bidRequests, bidderRequest); + + validateBuiltServerRequest(builtServerRequest, serverRequest); + }); + }); + context('when refererInfo values are available', function() { context('when refererInfo.page is defined', function() { it('returns corresponding server requests with site.page set', function() { @@ -1780,12 +1810,14 @@ describe('33acrossBidAdapter:', function () { .withProduct('siab') .withBanner() .withVideo() + .withCoppa(0) .build(); const req2 = new TtxRequestBuilder('sample33xGUID123456780') .withProduct('siab') .withBanner() .withVideo() + .withCoppa(0) .build(); req2.imp[0].id = 'b3'; @@ -1794,6 +1826,7 @@ describe('33acrossBidAdapter:', function () { .withProduct('inview') .withBanner() .withVideo() + .withCoppa(0) .build(); req3.imp[0].id = 'b4'; diff --git a/test/spec/modules/33acrossIdSystem_spec.js b/test/spec/modules/33acrossIdSystem_spec.js index 5070d2b8845..256f1df0ec9 100644 --- a/test/spec/modules/33acrossIdSystem_spec.js +++ b/test/spec/modules/33acrossIdSystem_spec.js @@ -2,7 +2,7 @@ import { thirthyThreeAcrossIdSubmodule } from 'modules/33acrossIdSystem.js'; import * as utils from 'src/utils.js'; import { server } from 'test/mocks/xhr.js'; -import { uspDataHandler } from 'src/adapterManager.js'; +import { uspDataHandler, coppaDataHandler } from 'src/adapterManager.js'; describe('33acrossIdSystem', () => { describe('name', () => { @@ -157,6 +157,48 @@ describe('33acrossIdSystem', () => { }); }); + context('when coppa is true', () => { + it('should call endpoint with the coppa=1', () => { + const completeCallback = () => {}; + const { callback } = thirthyThreeAcrossIdSubmodule.getId({ + params: { + pid: '12345' + } + }); + + sinon.stub(coppaDataHandler, 'getCoppa').returns(true); + + callback(completeCallback); + + const [request] = server.requests; + + expect(request.url).to.contain('coppa=1'); + + coppaDataHandler.getCoppa.restore(); + }); + }); + + context('when coppa is false', () => { + it('should call endpoint with the coppa=0', () => { + const completeCallback = () => {}; + const { callback } = thirthyThreeAcrossIdSubmodule.getId({ + params: { + pid: '12345' + } + }); + + sinon.stub(coppaDataHandler, 'getCoppa').returns(false); + + callback(completeCallback); + + const [request] = server.requests; + + expect(request.url).to.contain('coppa=0'); + + coppaDataHandler.getCoppa.restore(); + }); + }); + context('when the partner ID is not given', () => { it('should log an error', () => { const logErrorSpy = sinon.spy(utils, 'logError'); From c675633d5fc1650910fdaa7cf877c3c5b315633f Mon Sep 17 00:00:00 2001 From: Anthony Lin Date: Thu, 22 Jun 2023 14:45:10 -0400 Subject: [PATCH 2/3] set for all requests --- modules/33acrossBidAdapter.js | 7 +- test/spec/modules/33acrossBidAdapter_spec.js | 75 +++++++++++++++++--- 2 files changed, 68 insertions(+), 14 deletions(-) diff --git a/modules/33acrossBidAdapter.js b/modules/33acrossBidAdapter.js index 306586a2d59..73f3f61a60a 100644 --- a/modules/33acrossBidAdapter.js +++ b/modules/33acrossBidAdapter.js @@ -251,6 +251,7 @@ function _createServerRequest({ bidRequests, gdprConsent = {}, uspConsent, pageU const ttxRequest = {}; const firstBidRequest = bidRequests[0]; const { siteId, test } = firstBidRequest.params; + const coppaValue = !!(config.getConfig('coppa')); /* * Infer data for the request payload @@ -296,11 +297,7 @@ function _createServerRequest({ bidRequests, gdprConsent = {}, uspConsent, pageU }); } - const coppaValue = config.getConfig('coppa'); - - if (coppaValue) { - ttxRequest.regs.coppa = (coppaValue === true || coppaValue === 1) ? 1 : 0; - } + ttxRequest.regs.coppa = Number(coppaValue); ttxRequest.ext = { ttx: { diff --git a/test/spec/modules/33acrossBidAdapter_spec.js b/test/spec/modules/33acrossBidAdapter_spec.js index 9fed319911f..bceaf24d8bb 100644 --- a/test/spec/modules/33acrossBidAdapter_spec.js +++ b/test/spec/modules/33acrossBidAdapter_spec.js @@ -773,6 +773,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withViewability({amount: 100}) + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -791,6 +792,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withViewability({amount: 0}) + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -809,6 +811,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withViewability({amount: 75}) + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -828,6 +831,7 @@ describe('33acrossBidAdapter:', function () { .withProduct() .withSizes([{ w: 800, h: 2400 }]) .withViewability({amount: 25}) + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -847,6 +851,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withViewability({amount: spec.NON_MEASURABLE}) + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -878,6 +883,7 @@ describe('33acrossBidAdapter:', function () { } }) .withProduct() + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -920,6 +926,7 @@ describe('33acrossBidAdapter:', function () { } }) .withProduct() + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -966,6 +973,7 @@ describe('33acrossBidAdapter:', function () { } }) .withProduct() + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -992,6 +1000,7 @@ describe('33acrossBidAdapter:', function () { } }) .withProduct() + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1015,6 +1024,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withViewability({amount: 0}) + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1047,6 +1057,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withGdprConsent('foobarMyPreference', 1) + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1067,7 +1078,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withGdprConsent('foobarMyPreference', 1) - .withCoppa(0) + .withCoppa(1) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1084,6 +1095,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct() + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1103,7 +1115,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct() - .withCoppa(0) + .withCoppa(1) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1128,6 +1140,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withUspConsent('foo') + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1148,7 +1161,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withUspConsent('foo') - .withCoppa(0) + .withCoppa(1) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1165,6 +1178,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct() + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1184,7 +1198,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct() - .withCoppa(0) + .withCoppa(1) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1196,8 +1210,8 @@ describe('33acrossBidAdapter:', function () { }); }); - context('when coppa config exists', function() { - it('returns corresponding server requests with coppa data', function() { + context('when coppa returns true', function() { + it('returns corresponding server requests with coppa: 1', function() { sandbox.stub(config, 'getConfig').withArgs('coppa').returns(true); const ttxRequest = new TtxRequestBuilder() @@ -1214,6 +1228,24 @@ describe('33acrossBidAdapter:', function () { }); }); + context('when coppa returns false', function() { + it('returns corresponding server requests with coppa: 0', function() { + sandbox.stub(config, 'getConfig').withArgs('coppa').returns(false); + + const ttxRequest = new TtxRequestBuilder() + .withBanner() + .withProduct() + .withCoppa(0) + .build(); + const serverRequest = new ServerRequestBuilder() + .withData(ttxRequest) + .build(); + const [ builtServerRequest ] = spec.buildRequests(bidRequests, bidderRequest); + + validateBuiltServerRequest(builtServerRequest, serverRequest); + }); + }); + context('when refererInfo values are available', function() { context('when refererInfo.page is defined', function() { it('returns corresponding server requests with site.page set', function() { @@ -1228,6 +1260,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withPageUrl('http://foo.com/bar') + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1252,6 +1285,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withReferer('google.com') + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1270,6 +1304,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withGpid('fakeGPID0') + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1300,6 +1335,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct() + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1354,6 +1390,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withSchain(schain) + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1371,6 +1408,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct() + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() @@ -1388,6 +1426,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct() + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1405,6 +1444,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct() + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1429,6 +1469,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withFormatFloors('banner', [ 1.0, 0.10 ]) + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() @@ -1451,6 +1492,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withVideo() .withProduct('instream') + .withCoppa(0) .build(); ttxRequest.imp[0].video.placement = 1; @@ -1474,6 +1516,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withVideo({startdelay: -2, placement: 1}) .withProduct('instream') + .withCoppa(0) .build(); const [ builtServerRequest ] = spec.buildRequests(bidRequests, bidderRequest); @@ -1493,6 +1536,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withVideo() .withProduct('siab') + .withCoppa(0) .build(); ttxRequest.imp[0].video.placement = 2; @@ -1515,6 +1559,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withVideo({placement: 3, playbackmethod: [2]}) .withProduct('siab') + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() @@ -1537,6 +1582,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct('siab') + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() @@ -1558,6 +1604,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct('inview') + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() @@ -1582,6 +1629,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withVideo() .withProduct('siab') + .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() @@ -1604,6 +1652,7 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withVideo() .withProduct('siab') + .withCoppa(0) .build(); ttxRequest.imp[0].video.placement = 2; @@ -1630,6 +1679,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withVideo() .withProduct() + .withCoppa(0) .build(); const [ builtServerRequest ] = spec.buildRequests(bidRequests, bidderRequest); @@ -1658,6 +1708,7 @@ describe('33acrossBidAdapter:', function () { .withVideo() .withProduct() .withFloors('video', [ 1.0 ]) + .withCoppa(0) .build(); const [ builtServerRequest ] = spec.buildRequests(bidRequests, bidderRequest); @@ -1700,6 +1751,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withUserIds(eids) .withProduct() + .withCoppa(0) .build(); const [ builtServerRequest ] = spec.buildRequests(bidRequests, bidderRequest); @@ -1719,6 +1771,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withUserIds(eids) .withProduct() + .withCoppa(0) .build(); const [ builtServerRequest ] = spec.buildRequests(bidRequests, bidderRequest); @@ -1766,6 +1819,7 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withProduct() + .withCoppa(0) .build(); const [ builtServerRequest ] = spec.buildRequests(bidRequests, bidderRequest); @@ -1810,14 +1864,14 @@ describe('33acrossBidAdapter:', function () { .withProduct('siab') .withBanner() .withVideo() - .withCoppa(0) + .withCoppa(1) .build(); const req2 = new TtxRequestBuilder('sample33xGUID123456780') .withProduct('siab') .withBanner() .withVideo() - .withCoppa(0) + .withCoppa(1) .build(); req2.imp[0].id = 'b3'; @@ -1826,7 +1880,7 @@ describe('33acrossBidAdapter:', function () { .withProduct('inview') .withBanner() .withVideo() - .withCoppa(0) + .withCoppa(1) .build(); req3.imp[0].id = 'b4'; @@ -1871,12 +1925,14 @@ describe('33acrossBidAdapter:', function () { .withProduct('siab') .withBanner() .withVideo() + .withCoppa(0) .build(); const req2 = new TtxRequestBuilder() .withProduct('siab') .withBanner() .withVideo() + .withCoppa(0) .build(); req2.imp[0].id = 'b2'; @@ -1885,6 +1941,7 @@ describe('33acrossBidAdapter:', function () { .withProduct('siab') .withBanner() .withVideo() + .withCoppa(0) .build(); req3.imp[0].id = 'b3'; From 2663b607cd4b588463ba9dcf341f5e515f9c3405 Mon Sep 17 00:00:00 2001 From: Anthony Lin Date: Fri, 23 Jun 2023 12:37:35 -0400 Subject: [PATCH 3/3] feedback --- modules/33acrossBidAdapter.js | 6 ++- test/spec/modules/33acrossBidAdapter_spec.js | 43 +------------------- test/spec/modules/33acrossIdSystem_spec.js | 8 ++-- 3 files changed, 10 insertions(+), 47 deletions(-) diff --git a/modules/33acrossBidAdapter.js b/modules/33acrossBidAdapter.js index 73f3f61a60a..bdc80ade375 100644 --- a/modules/33acrossBidAdapter.js +++ b/modules/33acrossBidAdapter.js @@ -251,7 +251,7 @@ function _createServerRequest({ bidRequests, gdprConsent = {}, uspConsent, pageU const ttxRequest = {}; const firstBidRequest = bidRequests[0]; const { siteId, test } = firstBidRequest.params; - const coppaValue = !!(config.getConfig('coppa')); + const coppaValue = config.getConfig('coppa'); /* * Infer data for the request payload @@ -297,7 +297,9 @@ function _createServerRequest({ bidRequests, gdprConsent = {}, uspConsent, pageU }); } - ttxRequest.regs.coppa = Number(coppaValue); + if (coppaValue !== undefined) { + ttxRequest.regs.coppa = Number(!!coppaValue); + } ttxRequest.ext = { ttx: { diff --git a/test/spec/modules/33acrossBidAdapter_spec.js b/test/spec/modules/33acrossBidAdapter_spec.js index bceaf24d8bb..d0b590336b9 100644 --- a/test/spec/modules/33acrossBidAdapter_spec.js +++ b/test/spec/modules/33acrossBidAdapter_spec.js @@ -773,7 +773,6 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withViewability({amount: 100}) - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -792,7 +791,6 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withViewability({amount: 0}) - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -811,7 +809,6 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withViewability({amount: 75}) - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -831,7 +828,6 @@ describe('33acrossBidAdapter:', function () { .withProduct() .withSizes([{ w: 800, h: 2400 }]) .withViewability({amount: 25}) - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -851,7 +847,6 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withViewability({amount: spec.NON_MEASURABLE}) - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -883,7 +878,6 @@ describe('33acrossBidAdapter:', function () { } }) .withProduct() - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -926,7 +920,6 @@ describe('33acrossBidAdapter:', function () { } }) .withProduct() - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -973,7 +966,6 @@ describe('33acrossBidAdapter:', function () { } }) .withProduct() - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1000,7 +992,6 @@ describe('33acrossBidAdapter:', function () { } }) .withProduct() - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1024,7 +1015,6 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withViewability({amount: 0}) - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1057,7 +1047,6 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withGdprConsent('foobarMyPreference', 1) - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1095,7 +1084,6 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct() - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1140,7 +1128,6 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withUspConsent('foo') - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1178,7 +1165,6 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct() - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1210,7 +1196,7 @@ describe('33acrossBidAdapter:', function () { }); }); - context('when coppa returns true', function() { + context('when coppa is enabled', function() { it('returns corresponding server requests with coppa: 1', function() { sandbox.stub(config, 'getConfig').withArgs('coppa').returns(true); @@ -1228,7 +1214,7 @@ describe('33acrossBidAdapter:', function () { }); }); - context('when coppa returns false', function() { + context('when coppa is not enabled', function() { it('returns corresponding server requests with coppa: 0', function() { sandbox.stub(config, 'getConfig').withArgs('coppa').returns(false); @@ -1260,7 +1246,6 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withPageUrl('http://foo.com/bar') - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1285,7 +1270,6 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withReferer('google.com') - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1304,7 +1288,6 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withGpid('fakeGPID0') - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1335,7 +1318,6 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct() - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1390,7 +1372,6 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withSchain(schain) - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1408,7 +1389,6 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct() - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() @@ -1426,7 +1406,6 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct() - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1444,7 +1423,6 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct() - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() .withData(ttxRequest) @@ -1469,7 +1447,6 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withProduct() .withFormatFloors('banner', [ 1.0, 0.10 ]) - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() @@ -1492,7 +1469,6 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withVideo() .withProduct('instream') - .withCoppa(0) .build(); ttxRequest.imp[0].video.placement = 1; @@ -1516,7 +1492,6 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withVideo({startdelay: -2, placement: 1}) .withProduct('instream') - .withCoppa(0) .build(); const [ builtServerRequest ] = spec.buildRequests(bidRequests, bidderRequest); @@ -1536,7 +1511,6 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withVideo() .withProduct('siab') - .withCoppa(0) .build(); ttxRequest.imp[0].video.placement = 2; @@ -1559,7 +1533,6 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withVideo({placement: 3, playbackmethod: [2]}) .withProduct('siab') - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() @@ -1582,7 +1555,6 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct('siab') - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() @@ -1604,7 +1576,6 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withBanner() .withProduct('inview') - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() @@ -1629,7 +1600,6 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withVideo() .withProduct('siab') - .withCoppa(0) .build(); const serverRequest = new ServerRequestBuilder() @@ -1652,7 +1622,6 @@ describe('33acrossBidAdapter:', function () { .withBanner() .withVideo() .withProduct('siab') - .withCoppa(0) .build(); ttxRequest.imp[0].video.placement = 2; @@ -1679,7 +1648,6 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withVideo() .withProduct() - .withCoppa(0) .build(); const [ builtServerRequest ] = spec.buildRequests(bidRequests, bidderRequest); @@ -1708,7 +1676,6 @@ describe('33acrossBidAdapter:', function () { .withVideo() .withProduct() .withFloors('video', [ 1.0 ]) - .withCoppa(0) .build(); const [ builtServerRequest ] = spec.buildRequests(bidRequests, bidderRequest); @@ -1751,7 +1718,6 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withUserIds(eids) .withProduct() - .withCoppa(0) .build(); const [ builtServerRequest ] = spec.buildRequests(bidRequests, bidderRequest); @@ -1771,7 +1737,6 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withUserIds(eids) .withProduct() - .withCoppa(0) .build(); const [ builtServerRequest ] = spec.buildRequests(bidRequests, bidderRequest); @@ -1819,7 +1784,6 @@ describe('33acrossBidAdapter:', function () { const ttxRequest = new TtxRequestBuilder() .withProduct() - .withCoppa(0) .build(); const [ builtServerRequest ] = spec.buildRequests(bidRequests, bidderRequest); @@ -1925,14 +1889,12 @@ describe('33acrossBidAdapter:', function () { .withProduct('siab') .withBanner() .withVideo() - .withCoppa(0) .build(); const req2 = new TtxRequestBuilder() .withProduct('siab') .withBanner() .withVideo() - .withCoppa(0) .build(); req2.imp[0].id = 'b2'; @@ -1941,7 +1903,6 @@ describe('33acrossBidAdapter:', function () { .withProduct('siab') .withBanner() .withVideo() - .withCoppa(0) .build(); req3.imp[0].id = 'b3'; diff --git a/test/spec/modules/33acrossIdSystem_spec.js b/test/spec/modules/33acrossIdSystem_spec.js index 256f1df0ec9..e41d6d90d81 100644 --- a/test/spec/modules/33acrossIdSystem_spec.js +++ b/test/spec/modules/33acrossIdSystem_spec.js @@ -157,8 +157,8 @@ describe('33acrossIdSystem', () => { }); }); - context('when coppa is true', () => { - it('should call endpoint with the coppa=1', () => { + context('when coppa is enabled', () => { + it('should call endpoint with an enabled coppa signal', () => { const completeCallback = () => {}; const { callback } = thirthyThreeAcrossIdSubmodule.getId({ params: { @@ -178,8 +178,8 @@ describe('33acrossIdSystem', () => { }); }); - context('when coppa is false', () => { - it('should call endpoint with the coppa=0', () => { + context('when coppa is not enabled', () => { + it('should call endpoint with coppa signal not enabled', () => { const completeCallback = () => {}; const { callback } = thirthyThreeAcrossIdSubmodule.getId({ params: {