Skip to content

Commit

Permalink
Districtm DMX adapter support for CCPA (prebid#4560)
Browse files Browse the repository at this point in the history
* adding DMX

test @97%, two files added one updated

* Update districtm_spec.js

* Update districtmDMX.js

* adding all districtm needed file

* remove legacy file

* remove typo || 0 in the test method

* force default to return a valid width and height

* update unit test code for failing test

* changed class for an object

* remove package-lock.json

* change file name for dmx adapter

* renamed files

* restaure package-lock.json

* update to last package-lock state

* update gdpr user consent

* fix sizes issue

* Documentation updates

Adding the readme.md info

* update file name and update unit testing import file location

* current machine state

* lint correction

* remove variable assigment duplicate

* adding CCPA support for DMX

* adding test for ccpa and gdpr
  • Loading branch information
stevealliance authored and Isaac A. Dettman committed Dec 18, 2019
1 parent b878aa9 commit b051c0b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/districtmDMXBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ export const spec = {
dmxRequest.user.ext = {};
dmxRequest.user.ext.consent = bidderRequest.gdprConsent.consentString;
}
if (bidderRequest && bidderRequest.uspConsent) {
dmxRequest.regs = dmxRequest.regs || {};
dmxRequest.regs.ext = dmxRequest.regs.ext || {};
dmxRequest.regs.ext.us_privacy = bidderRequest.uspConsent;
}
try {
schain = bidRequest[0].schain;
dmxRequest.source = {};
Expand Down
7 changes: 7 additions & 0 deletions test/spec/modules/districtmDmxBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const bidderRequest = {
}],
'auctionStart': 1529511035677,
'timeout': 700,
'uspConsent': '1NY',
'gdprConsent': {
'consentString': 'BOPqNzUOPqNzUAHABBAAA5AAAAAAAA',
'vendorData': {
Expand Down Expand Up @@ -524,6 +525,12 @@ describe('DistrictM Adaptor', function () {
it(`the function should return an array`, function () {
expect(buildRequestResults).to.be.an('object');
});
it(`contain gdpr consent & ccpa`, function() {
const bidr = JSON.parse(buildRequestResults.data)
expect(bidr.regs.ext.gdpr).to.be.equal(1);
expect(bidr.regs.ext.us_privacy).to.be.equal('1NY');
expect(bidr.user.ext.consent).to.be.an('string');
});
it(`the function should return array length of 1`, function () {
expect(buildRequestResults.data).to.be.a('string');
});
Expand Down

0 comments on commit b051c0b

Please sign in to comment.