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

Undertone add parameters to request #4995

Merged
merged 21 commits into from
Mar 25, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d8779ee
* Update undertone adapter - change parameters - placementId paramete…
omerko May 30, 2018
6785395
* Update undertone adapter - change parameters - placementId paramete…
omerko May 30, 2018
c5611e3
fix lint issue in undertone adapter spec
omerko May 30, 2018
eea398e
Merge branch 'master' of https://github.com/prebid/Prebid.js
omerko Jul 15, 2018
ddcce01
added user sync function to undertone adapter
omerko Sep 13, 2018
2d5bd83
* Update undertone adapter - change parameters - placementId paramete…
omerko May 30, 2018
a33df49
added user sync function to undertone adapter
omerko Sep 13, 2018
467a238
added user sync function to undertone adapter
omerko Sep 16, 2018
4f3342c
Merge remote-tracking branch 'origin/master'
omerko Sep 16, 2018
95228a2
revert package-lock.json
omerko Oct 11, 2018
852cd6d
Merge branch 'master' of https://github.com/prebid/Prebid.js
AnnaPerion Mar 8, 2020
74cc4bd
send element coordinates and viewport
AnnaPerion Mar 15, 2020
00d2e42
Update undertoneBidAdapter.js
AnnaPerion Mar 17, 2020
e9dac72
add null in case of no data
AnnaPerion Mar 17, 2020
252383b
update according to fixes
AnnaPerion Mar 17, 2020
55fad56
added user sync function to undertone adapter
omerko Sep 13, 2018
33bf123
Merge branch 'master' of https://github.com/PerionNet/Prebid.js
AnnaPerion Mar 25, 2020
2a00e62
Merge remote-tracking branch 'origin/master' into UN-22446_Element-Pl…
AnnaPerion Mar 25, 2020
beba2be
Update undertoneBidAdapter.js
AnnaPerion Mar 25, 2020
624ac44
Merge remote-tracking branch 'origin/master' into UN-22446_Element-Pl…
AnnaPerion Mar 25, 2020
a7a709b
remove unneded changes after rebase
AnnaPerion Mar 25, 2020
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
Next Next commit
* Update undertone adapter - change parameters - placementId paramete…
…r is now optional and not mandatory - undertoneBidAdapter.js

* Updated undertone bid adapter tests accordingly - undertoneBidAdapter_spec.js
  • Loading branch information
omerko committed May 30, 2018
commit d8779eead9e8d24ede5f55340b30f1714de10f7b
4 changes: 2 additions & 2 deletions modules/undertoneBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const URL = '//hb.undertone.com/hb';
export const spec = {
code: BIDDER_CODE,
isBidRequestValid: function(bid) {
if (bid && bid.params && bid.params.publisherId && bid.params.placementId) {
if (bid && bid.params && bid.params.publisherId) {
bid.params.publisherId = parseInt(bid.params.publisherId);
return true;
}
Expand All @@ -37,7 +37,7 @@ export const spec = {
hbadaptor: 'prebid',
url: location.href,
domain: domain,
placementId: bidReq.params.placementId,
placementId: bidReq.params.placementId != undefined ? bidReq.params.placementId : null,
publisherId: bidReq.params.publisherId,
sizes: bidReq.sizes,
params: bidReq.params
Expand Down
26 changes: 20 additions & 6 deletions test/spec/modules/undertoneBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ const bidReq = [{
sizes: [[300, 250], [300, 600]],
bidId: '263be71e91dd9d',
auctionId: '9ad1fa8d-2297-4660-a018-b39945054746'
},{
bidder: BIDDER_CODE,
params: {
publisherId: 12345
},
sizes: [[1, 1]],
bidId: '453cf42d72bb3c',
auctionId: '6c22f5a5-59df-4dc6-b92c-f433bcf0a874\n'
}];

const validBidRes = {
Expand Down Expand Up @@ -97,12 +105,18 @@ describe('Undertone Adapter', () => {
});
it('should have all relevant fields', () => {
const request = spec.buildRequests(bidReq);
const bid = JSON.parse(request.data)['x-ut-hb-params'][0];
expect(bid.bidRequestId).to.equal('263be71e91dd9d');
expect(bid.sizes.length > 0).to.equal(true);
expect(bid.placementId).to.equal('10433394');
expect(bid.publisherId).to.equal(12345);
expect(bid.params).to.be.an('object');
const bid1 = JSON.parse(request.data)['x-ut-hb-params'][0];
expect(bid1.bidRequestId).to.equal('263be71e91dd9d');
expect(bid1.sizes.length).to.equal(2);
expect(bid1.placementId).to.equal('10433394');
expect(bid1.publisherId).to.equal(12345);
expect(bid1.params).to.be.an('object');
const bid2 = JSON.parse(request.data)['x-ut-hb-params'][1];
expect(bid2.bidRequestId).to.equal('453cf42d72bb3c');
expect(bid2.sizes.length).to.equal(1);
expect(bid2.placementId === null).to.equal(true);
expect(bid2.publisherId).to.equal(12345);
expect(bid2.params).to.be.an('object');
});
});

Expand Down