Skip to content

Commit

Permalink
add bidfloor to params object (#3641)
Browse files Browse the repository at this point in the history
* initial orbidder version in personal github repo

* use adUnits from orbidder_example.html

* replace obsolete functions

* forgot to commit the test

* check if bidderRequest object is available

* try to fix weird safari/ie issue

* ebayK: add more params

* update orbidderBidAdapter.md

* use spec.<function> instead of this.<function> for consistency reasons

* add bidfloor parameter to params object
  • Loading branch information
Hendrik Iseke authored and jaiminpanchal27 committed Mar 15, 2019
1 parent 9e0f00c commit 0c5fbab
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/orbidderBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const spec = {
return !!(bid.sizes && bid.bidId && bid.params &&
(bid.params.accountId && (typeof bid.params.accountId === 'string')) &&
(bid.params.placementId && (typeof bid.params.placementId === 'string')) &&
((typeof bid.params.bidfloor === 'undefined') || (typeof bid.params.bidfloor === 'number')) &&
((typeof bid.params.keyValues === 'undefined') || (typeof bid.params.keyValues === 'object')));
},

Expand Down
15 changes: 15 additions & 0 deletions test/spec/modules/orbidderBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ describe('orbidderBidAdapter', () => {
delete bidRequest.params;
expect(spec.isBidRequestValid(bidRequest)).to.equal(false);
});

it('accepts optional bidfloor', () => {
const bidRequest = deepClone(defaultBidRequest);
bidRequest.params.bidfloor = 123;
expect(spec.isBidRequestValid(bidRequest)).to.equal(true);

bidRequest.params.bidfloor = 1.23;
expect(spec.isBidRequestValid(bidRequest)).to.equal(true);
});

it('doesn\'t accept malformed bidfloor', () => {
const bidRequest = deepClone(defaultBidRequest);
bidRequest.params.bidfloor = 'another not usable string';
expect(spec.isBidRequestValid(bidRequest)).to.equal(false);
});
});

describe('buildRequests', () => {
Expand Down

0 comments on commit 0c5fbab

Please sign in to comment.