Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tmax #25

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

tmax #25

Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 timeout as a string', function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test name is incorrect, should be "should pass tmax as int - tmax received as string"

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 a string', 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