Skip to content

Commit

Permalink
LockerDome Bid Adapter: support for meta.advertiserDomains (#6921)
Browse files Browse the repository at this point in the history
* Add lockerdome adapter advertiserDomains support stub for Prebid 5.0

* Add lockerdome adapter advertiserDomains support stub for Prebid 5.0

* fix linting error

Co-authored-by: Chris Huie <phoenixtechnerd@gmail.com>
  • Loading branch information
margsliu and ChrisHuie authored Jun 2, 2021
1 parent b105b75 commit db50c5b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 4 additions & 1 deletion modules/lockerdomeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ export const spec = {
currency: bid.currency,
netRevenue: bid.netRevenue,
ad: bid.ad,
ttl: bid.ttl
ttl: bid.ttl,
meta: {
advertiserDomains: bid.adomain && Array.isArray(bid.adomain) ? bid.adomain : []
}
};
});
},
Expand Down
12 changes: 10 additions & 2 deletions test/spec/modules/lockerdomeBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ describe('LockerDomeAdapter', function () {
currency: 'USD',
netRevenue: true,
ad: '<!-- AD 1 CREATIVE -->',
ttl: 300
ttl: 300,
adomain: ['example.com']
},
{
requestId: '4510f2834773ce',
Expand All @@ -191,7 +192,8 @@ describe('LockerDomeAdapter', function () {
currency: 'USD',
netRevenue: true,
ad: '<!-- AD 2 CREATIVE -->',
ttl: 300
ttl: 300,
adomain: ['example.com']
}]
}
};
Expand All @@ -217,6 +219,9 @@ describe('LockerDomeAdapter', function () {
expect(interpretedResponse[0].netRevenue).to.equal(serverResponse.body.bids[0].netRevenue);
expect(interpretedResponse[0].ad).to.equal(serverResponse.body.bids[0].ad);
expect(interpretedResponse[0].ttl).to.equal(serverResponse.body.bids[0].ttl);
expect(interpretedResponse[0]).to.have.property('meta');
expect(interpretedResponse[0].meta).to.have.property('advertiserDomains');
expect(interpretedResponse[0].meta.advertiserDomains).to.deep.equal(serverResponse.body.bids[0].adomain);

expect(interpretedResponse[1].requestId).to.equal(serverResponse.body.bids[1].requestId);
expect(interpretedResponse[1].cpm).to.equal(serverResponse.body.bids[1].cpm);
Expand All @@ -227,6 +232,9 @@ describe('LockerDomeAdapter', function () {
expect(interpretedResponse[1].netRevenue).to.equal(serverResponse.body.bids[1].netRevenue);
expect(interpretedResponse[1].ad).to.equal(serverResponse.body.bids[1].ad);
expect(interpretedResponse[1].ttl).to.equal(serverResponse.body.bids[1].ttl);
expect(interpretedResponse[1]).to.have.property('meta');
expect(interpretedResponse[1].meta).to.have.property('advertiserDomains');
expect(interpretedResponse[1].meta.advertiserDomains).to.deep.equal(serverResponse.body.bids[1].adomain);
});
});
});

0 comments on commit db50c5b

Please sign in to comment.