Skip to content

Commit

Permalink
ConnectAd Bid-Adapter: Add adomain support (prebid#6859)
Browse files Browse the repository at this point in the history
* ConnectAd bid adapter: Add adomain support

Add adomain support

* ConnectAd Bid-Adapter: Add adomain support fix

* ConnectAd Bid-Adapter: Add adomain support

* ConnectAd Bid-Adapter: Add adomain support test update
  • Loading branch information
rtuschkany authored and agrandes-tappx committed Sep 29, 2021
1 parent 7b7c3c4 commit 383e199
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/connectadBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export const spec = {
bid.width = decision.width;
bid.height = decision.height;
bid.dealid = decision.dealid || null;
bid.meta = { advertiserDomains: decision && decision.adomain ? decision.adomain : [] };
bid.ad = retrieveAd(decision);
bid.currency = 'USD';
bid.creativeId = decision.adId;
Expand Down
39 changes: 38 additions & 1 deletion test/spec/modules/connectadBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,43 @@ describe('ConnectAd Adapter', function () {
});

describe('bid responses', function () {
it('should return complete bid response', function () {
it('should return complete bid response with adomain', function () {
const ADOMAINS = ['connectad.io'];

let serverResponse = {
body: {
decisions: {
'2f95c00074b931': {
adId: '0',
adomain: ['connectad.io'],
contents: [
{
body: '<<<---- Creative --->>>'
}
],
height: '250',
width: '300',
pricing: {
clearPrice: 11.899999999999999
}
}
}
}
};
const request = spec.buildRequests(bidRequests, bidderRequest);
const bids = spec.interpretResponse(serverResponse, request);

expect(bids).to.be.lengthOf(1);
expect(bids[0].cpm).to.equal(11.899999999999999);
expect(bids[0].width).to.equal('300');
expect(bids[0].height).to.equal('250');
expect(bids[0].ad).to.have.length.above(1);
expect(bids[0].meta.advertiserDomains).to.deep.equal(ADOMAINS);
});

it('should return complete bid response with empty adomain', function () {
const ADOMAINS = [];

let serverResponse = {
body: {
decisions: {
Expand Down Expand Up @@ -331,6 +367,7 @@ describe('ConnectAd Adapter', function () {
expect(bids[0].width).to.equal('300');
expect(bids[0].height).to.equal('250');
expect(bids[0].ad).to.have.length.above(1);
expect(bids[0].meta.advertiserDomains).to.deep.equal(ADOMAINS);
});

it('should return empty bid response', function () {
Expand Down

0 comments on commit 383e199

Please sign in to comment.