diff --git a/modules/adnuntiusBidAdapter.js b/modules/adnuntiusBidAdapter.js index 56f1bb02981e..8752e37a96f3 100644 --- a/modules/adnuntiusBidAdapter.js +++ b/modules/adnuntiusBidAdapter.js @@ -68,10 +68,10 @@ export const spec = { } else return response }, {}); - const bidResponse = bidRequest.bid.map(bid => bid.bidId) - .reduce((request, adunitId) => - request.concat(bidResponsesById[adunitId]) - , []); + const bidResponse = bidRequest.bid.map(bid => bid.bidId).reduce((request, adunitId) => { + if (bidResponsesById[adunitId]) { request.push(bidResponsesById[adunitId]) } + return request + }, []); return bidResponse }, diff --git a/test/spec/modules/adnuntiusBidAdapter_spec.js b/test/spec/modules/adnuntiusBidAdapter_spec.js index d234a345b5c6..62073fc6aaaa 100644 --- a/test/spec/modules/adnuntiusBidAdapter_spec.js +++ b/test/spec/modules/adnuntiusBidAdapter_spec.js @@ -78,8 +78,15 @@ describe('adnuntiusBidAdapter', function () { 'lineItemId': 'scyjdyv3mzgdsnpf', 'layoutId': 'sw6gtws2rdj1kwby', 'layoutName': 'Responsive image' - } + }, + ] + }, + { + 'auId': '000000000008b6bc', + 'targetId': '456', + 'matchedAdCount': 0, + 'responseId': 'adn-rsp-1460129238', } ] } @@ -115,7 +122,6 @@ describe('adnuntiusBidAdapter', function () { it('should return valid response when passed valid server response', function () { const interpretedResponse = spec.interpretResponse(serverResponse, singleBidRequest); const ad = serverResponse.body.adUnits[0].ads[0] - expect(interpretedResponse).to.have.lengthOf(1); expect(interpretedResponse[0].cpm).to.equal(ad.cpm.amount); expect(interpretedResponse[0].width).to.equal(Number(ad.creativeWidth));