Skip to content

Commit

Permalink
CAP-1879 - updates for pr
Browse files Browse the repository at this point in the history
  • Loading branch information
Corey Kress committed Jul 21, 2020
1 parent cd80003 commit fa60070
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/synacormediaBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

import { getAdUnitSizes, logWarn } from '../src/utils.js';
import { getAdUnitSizes, logWarn, deepSetValue } from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER, VIDEO } from '../src/mediaTypes.js';
import includes from 'core-js-pure/features/array/includes.js';
Expand Down Expand Up @@ -93,7 +93,7 @@ export const spec = {
if (!openRtbBidRequest.regs.ext) {
openRtbBidRequest.regs.ext = {};
}
openRtbBidRequest.regs.ext.us_privacy = bidderRequest.uspConsent;
deepSetValue(openRtbBidRequest, 'regs.ext.us_privacy', bidderRequest.uspConsent);
}

if (openRtbBidRequest.imp.length && seatId) {
Expand Down
20 changes: 20 additions & 0 deletions test/spec/modules/synacormediaBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ describe('synacormediaBidAdapter ', function () {
}
};

let bidderRequestWithCCPA = {
auctionId: 'xyz123',
refererInfo: {
referer: 'https://test.com/foo/bar'
},
uspConsent: '1YYY'
};

let expectedDataImp1 = {
banner: {
format: [
Expand Down Expand Up @@ -560,6 +568,18 @@ describe('synacormediaBidAdapter ', function () {
}
]);
});
it('should contain the CCPA privacy string when UspConsent is in bidder request', function() {
// banner test
let req = spec.buildRequests([validBidRequest], bidderRequestWithCCPA);
expect(req).be.an('object');
expect(req).to.have.property('method', 'POST');
expect(req).to.have.property('url');
expect(req.url).to.contain('https://prebid.technoratimedia.com/openrtb/bids/prebid?');
expect(req.data).to.exist.and.to.be.an('object');
expect(req.data.id).to.equal('xyz123');
expect(req.data.regs.ext.us_privacy).to.equal('1YYY');
expect(req.data.imp).to.eql([expectedDataImp1]);
})
});

describe('Bid Requests with schain object ', function() {
Expand Down

0 comments on commit fa60070

Please sign in to comment.