Skip to content

Commit

Permalink
Limelight Digital Bid Adapter: Add optional Publisher ID field (prebi…
Browse files Browse the repository at this point in the history
  • Loading branch information
imedvedko authored and Chris Pabst committed Jan 10, 2022
1 parent 17dfd00 commit eaf05d7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion modules/limelightDigitalBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ function buildPlacement(bidRequest) {
height: size[1]
}
}),
type: bidRequest.params.adUnitType.toUpperCase()
type: bidRequest.params.adUnitType.toUpperCase(),
publisherId: bidRequest.params.publisherId
}
}
}
17 changes: 10 additions & 7 deletions test/spec/modules/limelightDigitalBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ describe('limelightDigitalAdapter', function () {
params: {
host: 'exchange.ortb.net',
adUnitId: 123,
adUnitType: 'banner'
adUnitType: 'banner',
publisherId: 'perfectPublisher'
},
placementCode: 'placement_0',
auctionId: '74f78609-a92d-4cf1-869f-1b244bbfb5d2',
Expand Down Expand Up @@ -41,7 +42,8 @@ describe('limelightDigitalAdapter', function () {
params: {
host: 'exchange.ortb.net',
adUnitId: 789,
adUnitType: 'video'
adUnitType: 'video',
publisherId: 'secondPerfectPublisher'
},
placementCode: 'placement_2',
auctionId: 'e4771143-6aa7-41ec-8824-ced4342c96c8',
Expand Down Expand Up @@ -89,7 +91,7 @@ describe('limelightDigitalAdapter', function () {
expect(data.deviceHeight).to.be.a('number')
expect(data.secure).to.be.a('boolean')
data.adUnits.forEach(adUnit => {
expect(adUnit).to.have.all.keys('id', 'bidId', 'type', 'sizes', 'transactionId')
expect(adUnit).to.have.all.keys('id', 'bidId', 'type', 'sizes', 'transactionId', 'publisherId')
expect(adUnit.id).to.be.a('number')
expect(adUnit.bidId).to.be.a('string')
expect(adUnit.type).to.be.a('string')
Expand Down Expand Up @@ -456,10 +458,10 @@ describe('limelightDigitalAdapter', function () {
});

function validateAdUnit(adUnit, bid) {
expect(adUnit.id).to.equal(bid.params.adUnitId)
expect(adUnit.bidId).to.equal(bid.bidId)
expect(adUnit.type).to.equal(bid.params.adUnitType.toUpperCase())
expect(adUnit.transactionId).to.equal(bid.transactionId)
expect(adUnit.id).to.equal(bid.params.adUnitId);
expect(adUnit.bidId).to.equal(bid.bidId);
expect(adUnit.type).to.equal(bid.params.adUnitType.toUpperCase());
expect(adUnit.transactionId).to.equal(bid.transactionId);
let bidSizes = [];
if (bid.mediaTypes) {
if (bid.mediaTypes.video && bid.mediaTypes.video.playerSize) {
Expand All @@ -478,4 +480,5 @@ function validateAdUnit(adUnit, bid) {
height: size[1]
}
}));
expect(adUnit.publisherId).to.equal(bid.params.publisherId);
}

0 comments on commit eaf05d7

Please sign in to comment.