diff --git a/modules/quantcastBidAdapter.js b/modules/quantcastBidAdapter.js index cd513111870..e059bfdb4e4 100644 --- a/modules/quantcastBidAdapter.js +++ b/modules/quantcastBidAdapter.js @@ -123,7 +123,7 @@ export const spec = { * */ interpretResponse(serverResponse) { - const response = serverResponse; + const response = serverResponse['body']; if ( response === undefined || diff --git a/test/spec/modules/quantcastBidAdapter_spec.js b/test/spec/modules/quantcastBidAdapter_spec.js index bb10e0682da..c38a0b77334 100644 --- a/test/spec/modules/quantcastBidAdapter_spec.js +++ b/test/spec/modules/quantcastBidAdapter_spec.js @@ -136,7 +136,7 @@ describe('Quantcast adapter', () => { describe('`interpretResponse`', () => { // The sample response is from https://wiki.corp.qc/display/adinf/QCX - const response = { + const body = { bidderCode: 'qcx', // Renaming it to use CamelCase since that is what is used in the Prebid.js variable name requestId: 'erlangcluster@qa-rtb002.us-ec.adtech.com-11417780270886458', // Added this field. This is not used now but could be useful in troubleshooting later on. Specially for sites using iFrames bids: [ @@ -152,6 +152,11 @@ describe('Quantcast adapter', () => { ] }; + const response = { + body, + headers: {} + }; + it('should return an empty array if `serverResponse` is `undefined`', () => { const interpretedResponse = qcSpec.interpretResponse(); @@ -185,11 +190,15 @@ describe('Quantcast adapter', () => { }); it('handles no bid response', () => { - const response = { + const body = { bidderCode: 'qcx', // Renaming it to use CamelCase since that is what is used in the Prebid.js variable name requestId: 'erlangcluster@qa-rtb002.us-ec.adtech.com-11417780270886458', // Added this field. This is not used now but could be useful in troubleshooting later on. Specially for sites using iFrames bids: [] }; + const response = { + body, + headers: {} + }; const expectedResponse = []; const interpretedResponse = qcSpec.interpretResponse(response);