Skip to content

Commit

Permalink
LimelightDigital Adapter: Add support of ortb2 and ortb2Imp objects (#…
Browse files Browse the repository at this point in the history
…12078)

* Add support of ortb2 and ortb2Imp objects

* Fix tests

* Fix tests

---------

Co-authored-by: apykhteyev <alex@project-limelight.com>
  • Loading branch information
apykhteyev and apykhteyev authored Aug 9, 2024
1 parent 2a62970 commit 776b7fd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
3 changes: 3 additions & 0 deletions modules/limelightDigitalBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ function buildRequest(winTop, host, adUnits, bidderRequest) {
deviceWidth: winTop.screen.width,
deviceHeight: winTop.screen.height,
adUnits: adUnits,
ortb2: bidderRequest?.ortb2,
refererInfo: bidderRequest?.refererInfo,
sua: bidderRequest?.ortb2?.device?.sua,
page: bidderRequest?.ortb2?.site?.page || bidderRequest?.refererInfo?.page
}
Expand Down Expand Up @@ -164,6 +166,7 @@ function buildPlacement(bidRequest) {
}
}),
type: bidRequest.params.adUnitType.toUpperCase(),
ortb2Imp: bidRequest.ortb2Imp,
publisherId: bidRequest.params.publisherId,
userIdAsEids: bidRequest.userIdAsEids,
supplyChain: bidRequest.schain,
Expand Down
30 changes: 26 additions & 4 deletions test/spec/modules/limelightDigitalBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ describe('limelightDigitalAdapter', function () {
},
ortb2Imp: {
ext: {
tid: '3bb2f6da-87a6-4029-aeb0-bfe951372e62',
gpid: '/1111/homepage#300x250',
tid: '738d5915-6651-43b9-9b6b-d50517350917',
data: {
'pbadslot': '/1111/homepage#300x250'
}
}
},
userIdAsEids: [
Expand Down Expand Up @@ -70,7 +74,11 @@ describe('limelightDigitalAdapter', function () {
sizes: [[350, 200]],
ortb2Imp: {
ext: {
tid: '068867d1-46ec-40bb-9fa0-e24611786fb4',
gpid: '/1111/homepage#300x250',
tid: '738d5915-6651-43b9-9b6b-d50517350917',
data: {
'pbadslot': '/1111/homepage#300x250'
}
}
},
userIdAsEids: [
Expand Down Expand Up @@ -120,7 +128,11 @@ describe('limelightDigitalAdapter', function () {
sizes: [[800, 600]],
ortb2Imp: {
ext: {
gpid: '/1111/homepage#300x250',
tid: '738d5915-6651-43b9-9b6b-d50517350917',
data: {
'pbadslot': '/1111/homepage#300x250'
}
}
},
userIdAsEids: [
Expand Down Expand Up @@ -169,7 +181,11 @@ describe('limelightDigitalAdapter', function () {
},
ortb2Imp: {
ext: {
gpid: '/1111/homepage#300x250',
tid: '738d5915-6651-43b9-9b6b-d50517350917',
data: {
'pbadslot': '/1111/homepage#300x250'
}
}
},
userIdAsEids: [
Expand Down Expand Up @@ -235,7 +251,9 @@ describe('limelightDigitalAdapter', function () {
'secure',
'adUnits',
'sua',
'page'
'page',
'ortb2',
'refererInfo'
);
expect(data.deviceWidth).to.be.a('number');
expect(data.deviceHeight).to.be.a('number');
Expand All @@ -254,7 +272,8 @@ describe('limelightDigitalAdapter', function () {
'custom2',
'custom3',
'custom4',
'custom5'
'custom5',
'ortb2Imp'
);
expect(adUnit.id).to.be.a('number');
expect(adUnit.bidId).to.be.a('string');
Expand All @@ -268,13 +287,15 @@ describe('limelightDigitalAdapter', function () {
expect(adUnit.custom3).to.be.a('string');
expect(adUnit.custom4).to.be.a('string');
expect(adUnit.custom5).to.be.a('string');
expect(adUnit.ortb2Imp).to.be.an('object');
})
expect(data.sua.browsers).to.be.a('array');
expect(data.sua.platform).to.be.a('array');
expect(data.sua.mobile).to.be.a('number');
expect(data.sua.architecture).to.be.a('string');
expect(data.page).to.be.a('string');
expect(data.page).to.be.equal('testPage');
expect(data.ortb2).to.be.an('object');
})
})
it('Returns valid URL', function () {
Expand Down Expand Up @@ -719,4 +740,5 @@ function validateAdUnit(adUnit, bid) {
expect(adUnit.publisherId).to.equal(bid.params.publisherId);
expect(adUnit.userIdAsEids).to.deep.equal(bid.userIdAsEids);
expect(adUnit.supplyChain).to.deep.equal(bid.schain);
expect(adUnit.ortb2Imp).to.deep.equal(bid.ortb2Imp);
}

0 comments on commit 776b7fd

Please sign in to comment.