Skip to content

Commit

Permalink
ZetaSppBidAdapter: provide tmax (prebid#9240)
Browse files Browse the repository at this point in the history
Co-authored-by: Surovenko Alexey <surovenko.alexey@gmail.com>
  • Loading branch information
2 people authored and jorgeluisrocha committed May 18, 2023
1 parent 5016eec commit ca26585
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 ca26585

Please sign in to comment.