From bee2344ab901d411e7855fbef81ca2a4a704cf30 Mon Sep 17 00:00:00 2001 From: Li Xinyang Date: Wed, 25 Oct 2017 10:12:49 +0800 Subject: [PATCH] Update the first argument for interpretResponse method and its spec --- modules/quantcastBidAdapter.js | 2 +- test/spec/modules/quantcastBidAdapter_spec.js | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) 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);