From 5ef88dba12a00fc7b31a70ccb127e7c2794ef8d8 Mon Sep 17 00:00:00 2001 From: Patrick McCann Date: Thu, 25 Jun 2020 11:12:18 -0400 Subject: [PATCH 1/4] add test case for missing adomain in ix adapter at request of @ix-prebid-support on https://github.com/prebid/Prebid.js/pull/5404 --- test/spec/modules/ixBidAdapter_spec.js | 56 ++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/test/spec/modules/ixBidAdapter_spec.js b/test/spec/modules/ixBidAdapter_spec.js index 3e0f5845907..c84c5383258 100644 --- a/test/spec/modules/ixBidAdapter_spec.js +++ b/test/spec/modules/ixBidAdapter_spec.js @@ -110,6 +110,35 @@ describe('IndexexchangeAdapter', function () { ] }; + const DEFAULT_BANNER_BID_RESPONSE_WITHOUT_ADOMAIN = { + cur: 'USD', + id: '11a22b33c44d', + seatbid: [ + { + bid: [ + { + crid: '12345', + adid: '14851455', + impid: '1a2b3c4d', + cid: '3051266', + price: 100, + w: 300, + h: 250, + id: '1', + ext: { + dspid: 50, + pricelevel: '_100', + advbrandid: 303325, + advbrand: 'OECTA' + }, + adm: '' + } + ], + seat: '3970' + } + ] + }; + const DEFAULT_VIDEO_BID_RESPONSE = { cur: 'USD', id: '1aa2bb3cc4de', @@ -843,6 +872,33 @@ describe('IndexexchangeAdapter', function () { const result = spec.interpretResponse({ body: DEFAULT_BANNER_BID_RESPONSE }, { data: DEFAULT_BIDDER_REQUEST_DATA }); expect(result[0]).to.deep.equal(expectedParse[0]); }); + + + describe('interpretResponse', function () { + it('should get correct bid response for banner ad with missing adomain', function () { + const expectedParse = [ + { + requestId: '1a2b3c4d', + cpm: 1, + creativeId: '12345', + width: 300, + height: 250, + mediaType: 'banner', + ad: '', + currency: 'USD', + ttl: 300, + netRevenue: true, + dealId: undefined, + meta: { + networkId: 50, + brandId: 303325, + brandName: 'OECTA' + } + } + ]; + const result = spec.interpretResponse({ body: DEFAULT_BANNER_BID_RESPONSE_WITHOUT_ADOMAIN }, { data: DEFAULT_BIDDER_REQUEST_DATA }); + expect(result[0]).to.deep.equal(expectedParse[0]); + }); it('should set creativeId to default value if not provided', function () { const bidResponse = utils.deepClone(DEFAULT_BANNER_BID_RESPONSE); From cf06f8ed9bb028a5a7c8cc38be166f56a6c5a1b0 Mon Sep 17 00:00:00 2001 From: Patrick McCann Date: Thu, 25 Jun 2020 11:15:54 -0400 Subject: [PATCH 2/4] Update ixBidAdapter_spec.js From 69d4c3760b836ebaaf5ab0725c905d28c6bef54a Mon Sep 17 00:00:00 2001 From: Patrick McCann Date: Thu, 25 Jun 2020 11:18:22 -0400 Subject: [PATCH 3/4] Update ixBidAdapter_spec.js --- test/spec/modules/ixBidAdapter_spec.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/spec/modules/ixBidAdapter_spec.js b/test/spec/modules/ixBidAdapter_spec.js index c84c5383258..7f9c78ede20 100644 --- a/test/spec/modules/ixBidAdapter_spec.js +++ b/test/spec/modules/ixBidAdapter_spec.js @@ -872,9 +872,7 @@ describe('IndexexchangeAdapter', function () { const result = spec.interpretResponse({ body: DEFAULT_BANNER_BID_RESPONSE }, { data: DEFAULT_BIDDER_REQUEST_DATA }); expect(result[0]).to.deep.equal(expectedParse[0]); }); - - - describe('interpretResponse', function () { + it('should get correct bid response for banner ad with missing adomain', function () { const expectedParse = [ { From 3b3cf9795b1d1d42dbb732c8b7bfded9da89cabb Mon Sep 17 00:00:00 2001 From: Patrick McCann Date: Thu, 25 Jun 2020 11:30:42 -0400 Subject: [PATCH 4/4] Update ixBidAdapter_spec.js --- test/spec/modules/ixBidAdapter_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/spec/modules/ixBidAdapter_spec.js b/test/spec/modules/ixBidAdapter_spec.js index 7f9c78ede20..5fddca618ca 100644 --- a/test/spec/modules/ixBidAdapter_spec.js +++ b/test/spec/modules/ixBidAdapter_spec.js @@ -110,7 +110,7 @@ describe('IndexexchangeAdapter', function () { ] }; - const DEFAULT_BANNER_BID_RESPONSE_WITHOUT_ADOMAIN = { + const DEFAULT_BANNER_BID_RESPONSE_WITHOUT_ADOMAIN = { cur: 'USD', id: '11a22b33c44d', seatbid: [