Skip to content

Commit

Permalink
Add supply chain support for Teads adapter (#4420)
Browse files Browse the repository at this point in the history
  • Loading branch information
aandrieu authored and Fawke committed Nov 8, 2019
1 parent 7f7f6ed commit 28d242d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/teadsBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export const spec = {
hb_version: '$prebid.version$'
};

if (validBidRequests[0].schain) {
payload.schain = validBidRequests[0].schain;
}

let gdpr = bidderRequest.gdprConsent;
if (bidderRequest && gdpr) {
let isCmp = (typeof gdpr.gdprApplies === 'boolean')
Expand Down
28 changes: 28 additions & 0 deletions test/spec/modules/teadsBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,34 @@ describe('teadsBidAdapter', () => {
checkMediaTypesSizes(mediaTypesPlayerSize, '32x34')
});

it('should add schain info to payload if available', function () {
const bidRequest = Object.assign({}, bidRequests[0], {
schain: {
ver: '1.0',
complete: 1,
nodes: [{
asi: 'example.com',
sid: '00001',
hp: 1
}]
}
});

const request = spec.buildRequests([bidRequest], bidderResquestDefault);
const payload = JSON.parse(request.data);

expect(payload.schain).to.exist;
expect(payload.schain).to.deep.equal({
ver: '1.0',
complete: 1,
nodes: [{
asi: 'example.com',
sid: '00001',
hp: 1
}]
});
});

it('should use good mediaTypes video sizes', function() {
const mediaTypesVideoSizes = {
'mediaTypes': {
Expand Down

0 comments on commit 28d242d

Please sign in to comment.