Skip to content

Commit

Permalink
Adyoulike Bidder Adapter - schain support (#8486)
Browse files Browse the repository at this point in the history
* add schain data to the bid request

* add unit test with schain data
  • Loading branch information
guiann authored May 27, 2022
1 parent 1463225 commit 8702ee5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions modules/adyoulikeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ export const spec = {
if (typeof bidReq.getFloor === 'function') {
accumulator[bidReq.bidId].Pricing = getFloor(bidReq, size, mediatype);
}
if (bidReq.schain) {
accumulator[bidReq.bidId].SChain = bidReq.schain;
}
if (mediatype === NATIVE) {
let nativeReq = bidReq.mediaTypes.native;
if (nativeReq.type === 'image') {
Expand Down
17 changes: 16 additions & 1 deletion test/spec/modules/adyoulikeBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,20 @@ describe('Adyoulike Adapter', function () {
}
},
},
'schain': {
validation: 'strict',
config: {
ver: '1.0',
complete: 1,
nodes: [
{
asi: 'indirectseller.com',
sid: '00001',
hp: 1
}
]
}
},
'transactionId': 'bid_id_0_transaction_id'
}
];
Expand Down Expand Up @@ -614,7 +628,7 @@ describe('Adyoulike Adapter', function () {
expect(request.url).to.contain(getEndpoint());
});

it('should add gdpr/usp consent information to the request', function () {
it('should add gdpr/usp consent information and SChain to the request', function () {
let consentString = 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A==';
let uspConsentData = '1YCC';
let bidderRequest = {
Expand All @@ -637,6 +651,7 @@ describe('Adyoulike Adapter', function () {
expect(payload.gdprConsent.consentString).to.exist.and.to.equal(consentString);
expect(payload.gdprConsent.consentRequired).to.exist.and.to.be.true;
expect(payload.uspConsent).to.exist.and.to.equal(uspConsentData);
expect(payload.Bids.bid_id_0.SChain).to.exist.and.to.deep.equal(bidRequestWithSinglePlacement[0].schain);
});

it('should not set a default value for gdpr consentRequired', function () {
Expand Down

0 comments on commit 8702ee5

Please sign in to comment.