Skip to content

Commit 0c5fbab

Browse files
Hendrik Isekejaiminpanchal27
Hendrik Iseke
authored andcommitted
add bidfloor to params object (prebid#3641)
* 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
1 parent 9e0f00c commit 0c5fbab

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

modules/orbidderBidAdapter.js

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const spec = {
1818
return !!(bid.sizes && bid.bidId && bid.params &&
1919
(bid.params.accountId && (typeof bid.params.accountId === 'string')) &&
2020
(bid.params.placementId && (typeof bid.params.placementId === 'string')) &&
21+
((typeof bid.params.bidfloor === 'undefined') || (typeof bid.params.bidfloor === 'number')) &&
2122
((typeof bid.params.keyValues === 'undefined') || (typeof bid.params.keyValues === 'object')));
2223
},
2324

test/spec/modules/orbidderBidAdapter_spec.js

+15
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,21 @@ describe('orbidderBidAdapter', () => {
6464
delete bidRequest.params;
6565
expect(spec.isBidRequestValid(bidRequest)).to.equal(false);
6666
});
67+
68+
it('accepts optional bidfloor', () => {
69+
const bidRequest = deepClone(defaultBidRequest);
70+
bidRequest.params.bidfloor = 123;
71+
expect(spec.isBidRequestValid(bidRequest)).to.equal(true);
72+
73+
bidRequest.params.bidfloor = 1.23;
74+
expect(spec.isBidRequestValid(bidRequest)).to.equal(true);
75+
});
76+
77+
it('doesn\'t accept malformed bidfloor', () => {
78+
const bidRequest = deepClone(defaultBidRequest);
79+
bidRequest.params.bidfloor = 'another not usable string';
80+
expect(spec.isBidRequestValid(bidRequest)).to.equal(false);
81+
});
6782
});
6883

6984
describe('buildRequests', () => {

0 commit comments

Comments
 (0)