From b1e601aa4e29553871b372d0aeee7086b613c008 Mon Sep 17 00:00:00 2001 From: barRubi <151519394+barRubi@users.noreply.github.com> Date: Mon, 27 Nov 2023 17:13:49 +0200 Subject: [PATCH] Taboola Bid Adapter: cast tmax type (#10766) * tmax * tmax * tmax * tmax --- modules/taboolaBidAdapter.js | 2 +- test/spec/modules/taboolaBidAdapter_spec.js | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/modules/taboolaBidAdapter.js b/modules/taboolaBidAdapter.js index 86766200aaa..0d56d6daec7 100644 --- a/modules/taboolaBidAdapter.js +++ b/modules/taboolaBidAdapter.js @@ -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 || [], diff --git a/test/spec/modules/taboolaBidAdapter_spec.js b/test/spec/modules/taboolaBidAdapter_spec.js index 16bbb525ee7..1b6104599d7 100644 --- a/test/spec/modules/taboolaBidAdapter_spec.js +++ b/test/spec/modules/taboolaBidAdapter_spec.js @@ -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 = {