Skip to content

Commit

Permalink
ePlanning Bid Adapter : fix support for video auction (#9283)
Browse files Browse the repository at this point in the history
* Fix ad vast

* fix lint spaces in tests

* fix lint spaces in tests

* fix lint spaces in tests
  • Loading branch information
fndigrazia authored Nov 27, 2022
1 parent 737646f commit e32be90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 2 additions & 6 deletions modules/eplanningBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ export const spec = {
advertiserDomains: ad.adom
};
}
if (isVastResponse(ad)) {
if (request && request.data && request.data.vv) {
bidResponse.vastXml = ad.adm;
bidResponse.mediaTypes = VIDEO;
bidResponse.mediaType = VIDEO;
} else {
bidResponse.ad = ad.adm;
}
Expand Down Expand Up @@ -504,8 +504,4 @@ function registerAuction(storageID) {
return true;
}

function isVastResponse(bid) {
return bid.adm.match(/^(<VAST)|(<VideoAdServingTemplate)/gmi);
}

registerBidder(spec);
8 changes: 4 additions & 4 deletions test/spec/modules/eplanningBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ describe('E-Planning Adapter', function () {
});

it('should correctly map the parameters in the response vast', function () {
const bidResponse = spec.interpretResponse(responseVast, { adUnitToBidId: { [CLEAN_ADUNIT_CODE_VAST]: BID_ID } })[0];
const bidResponse = spec.interpretResponse(responseVast, { adUnitToBidId: { [CLEAN_ADUNIT_CODE_VAST]: BID_ID }, data: { vv: 2 } })[0];
const expectedResponse = {
requestId: BID_ID,
cpm: CPM,
Expand All @@ -851,13 +851,13 @@ describe('E-Planning Adapter', function () {
netRevenue: true,
currency: 'USD',
vastXml: ADM_VAST,
mediaTypes: VIDEO
mediaType: VIDEO
};
expect(bidResponse).to.deep.equal(expectedResponse);
});

it('should correctly map the parameters in the response vast vv 1', function () {
const bidResponse = spec.interpretResponse(responseVastVV1, { adUnitToBidId: { [CLEAN_ADUNIT_CODE_VAST]: BID_ID } })[0];
const bidResponse = spec.interpretResponse(responseVastVV1, { adUnitToBidId: { [CLEAN_ADUNIT_CODE_VAST]: BID_ID }, data: { vv: 1 } })[0];
const expectedResponse = {
requestId: BID_ID,
cpm: CPM,
Expand All @@ -868,7 +868,7 @@ describe('E-Planning Adapter', function () {
netRevenue: true,
currency: 'USD',
vastXml: ADM_VAST_VV_1,
mediaTypes: VIDEO
mediaType: VIDEO
};
expect(bidResponse).to.deep.equal(expectedResponse);
});
Expand Down

0 comments on commit e32be90

Please sign in to comment.