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

ConnectAd Bid-Adapter: Add adomain support #6859

Merged
merged 6 commits into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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