Skip to content

Commit

Permalink
Taboola Bid Adapter: cast tmax type (#10766)
Browse files Browse the repository at this point in the history
* tmax

* tmax

* tmax

* tmax
  • Loading branch information
barRubi authored Nov 27, 2023
1 parent 656680b commit b1e601a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/taboolaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const spec = {
site,
device,
source: {fd: 1},
tmax: bidderRequest.timeout,
tmax: (bidderRequest.timeout == undefined) ? undefined : parseInt(bidderRequest.timeout),
bcat: ortb2.bcat || bidRequest.params.bcat || [],
badv: ortb2.badv || bidRequest.params.badv || [],
wlang: ortb2.wlang || bidRequest.params.wlang || [],
Expand Down
20 changes: 20 additions & 0 deletions test/spec/modules/taboolaBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,26 @@ describe('Taboola Adapter', function () {
expect(resData.tmax).to.equal(500);
});

it('should pass bidder tmax as int', function () {
const bidderRequest = {
...commonBidderRequest,
timeout: '500'
}
const res = spec.buildRequests([defaultBidRequest], bidderRequest);
const resData = JSON.parse(res.data);
expect(resData.tmax).to.equal(500);
});

it('should pass bidder timeout as null', function () {
const bidderRequest = {
...commonBidderRequest,
timeout: null
}
const res = spec.buildRequests([defaultBidRequest], bidderRequest);
const resData = JSON.parse(res.data);
expect(resData.tmax).to.equal(undefined);
});

describe('first party data', function () {
it('should parse first party data', function () {
const bidderRequest = {
Expand Down

0 comments on commit b1e601a

Please sign in to comment.