Skip to content

Commit

Permalink
ZetaSppBidAdapter: provide tmax (#9240)
Browse files Browse the repository at this point in the history
Co-authored-by: Surovenko Alexey <surovenko.alexey@gmail.com>
  • Loading branch information
asurovenko-zeta and surovenko authored Nov 14, 2022
1 parent 06ce1ab commit 12cad7b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions modules/zeta_global_sspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ export const spec = {
deepSetValue(payload, 'regs.ext.us_privacy', bidderRequest.uspConsent);
}

if (bidderRequest?.timeout) {
payload.tmax = bidderRequest.timeout;
}

provideEids(validBidRequests[0], payload);
const url = params.shortname ? ENDPOINT_URL.concat('?shortname=', params.shortname) : ENDPOINT_URL;
return {
Expand Down
17 changes: 16 additions & 1 deletion test/spec/modules/zeta_global_sspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ describe('Zeta Ssp Bid Adapter', function () {
},
uspConsent: 'someCCPAString',
params: params,
userIdAsEids: eids
userIdAsEids: eids,
timeout: 500
}];

const videoRequest = [{
Expand Down Expand Up @@ -344,4 +345,18 @@ describe('Zeta Ssp Bid Adapter', function () {
expect(payload.imp[1].banner.w).to.eql(600);
expect(payload.imp[1].banner.h).to.eql(400);
});

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

expect(payload.tmax).to.eql(500);
});

it('Test provide tmax without value', function () {
const request = spec.buildRequests(videoRequest, videoRequest[0]);
const payload = JSON.parse(request.data);

expect(payload.tmax).to.be.undefined;
});
});

0 comments on commit 12cad7b

Please sign in to comment.