Skip to content

Commit

Permalink
ZetaGlobalSsp: provide schain (#9678)
Browse files Browse the repository at this point in the history
Co-authored-by: Surovenko Alexey <surovenko.alexey@gmail.com>
Co-authored-by: Alexey Surovenko <ASurovenko@vdhk6ddf9m.home>
  • Loading branch information
3 people authored Mar 17, 2023
1 parent 06df26e commit fed98c1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/zeta_global_sspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ export const spec = {
deepSetValue(payload, 'regs.ext.us_privacy', bidderRequest.uspConsent);
}

// schain
if (validBidRequests[0].schain) {
payload.source = {
ext: {
schain: validBidRequests[0].schain
}
}
}

if (bidderRequest?.timeout) {
payload.tmax = bidderRequest.timeout;
}
Expand Down
24 changes: 24 additions & 0 deletions test/spec/modules/zeta_global_sspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ describe('Zeta Ssp Bid Adapter', function () {
}
];

const schain = {
complete: 1,
nodes: [
{
asi: 'asi1',
sid: 'sid1',
rid: 'rid1'
},
{
asi: 'asi2',
sid: 'sid2',
rid: 'rid2'
}
]
};

const params = {
user: {
uid: 222,
Expand Down Expand Up @@ -103,6 +119,7 @@ describe('Zeta Ssp Bid Adapter', function () {
gdprApplies: 1,
consentString: 'consentString'
},
schain: schain,
uspConsent: 'someCCPAString',
params: params,
userIdAsEids: eids,
Expand Down Expand Up @@ -372,4 +389,11 @@ describe('Zeta Ssp Bid Adapter', function () {
expect(spec.onTimeout).to.exist.and.to.be.a('function');
expect(spec.onTimeout({ timeout: 1000 })).to.be.undefined;
});

it('Test schain provided', function () {
const request = spec.buildRequests(bannerRequest, bannerRequest[0]);
const payload = JSON.parse(request.data);

expect(payload.source.ext.schain).to.eql(schain);
});
});

0 comments on commit fed98c1

Please sign in to comment.