Skip to content

Commit

Permalink
Added meta.advertiserDomains to bidResponse (prebid#6853)
Browse files Browse the repository at this point in the history
  • Loading branch information
ardit-baloku authored and agrandes-tappx committed Sep 29, 2021
1 parent 6351a8a commit 970c989
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
5 changes: 4 additions & 1 deletion modules/gjirafaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ export const spec = {
referrer: responses[i].Referrer,
ad: responses[i].Ad,
vastUrl: responses[i].VastUrl,
mediaType: responses[i].MediaType
mediaType: responses[i].MediaType,
meta: {
advertiserDomains: Array.isArray(responses[i].ADomain) ? responses[i].ADomain : []
}
};
bidResponses.push(bidResponse);
}
Expand Down
21 changes: 19 additions & 2 deletions test/spec/modules/gjirafaBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ describe('gjirafaAdapterTest', () => {
'CreativeId': '123abc',
'NetRevenue': false,
'Currency': 'EUR',
'TTL': 360
'TTL': 360,
'ADomain': ['somedomain.com']
}],
headers: {}
};
Expand All @@ -156,13 +157,29 @@ describe('gjirafaAdapterTest', () => {
'referrer',
'ad',
'vastUrl',
'mediaType'
'mediaType',
'meta'
];

let resultKeys = Object.keys(result[0]);
resultKeys.forEach(function (key) {
expect(keys.indexOf(key) !== -1).to.equal(true);
});
})

it('all values correct', () => {
const result = spec.interpretResponse(bidResponse, bidRequest);

expect(result[0].cpm).to.equal(1);
expect(result[0].width).to.equal(728);
expect(result[0].height).to.equal(90);
expect(result[0].creativeId).to.equal('123abc');
expect(result[0].currency).to.equal('EUR');
expect(result[0].netRevenue).to.equal(false);
expect(result[0].ttl).to.equal(360);
expect(result[0].referrer).to.equal('http://localhost:9999/integrationExamples/gpt/hello_world.html?pbjs_debug=true');
expect(result[0].ad).to.equal('<div>Test ad</div>');
expect(result[0].meta.advertiserDomains).to.deep.equal(['somedomain.com']);
})
});
});

0 comments on commit 970c989

Please sign in to comment.