Skip to content

Commit

Permalink
Update the first argument for interpretResponse method and its spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Li Xinyang committed Oct 25, 2017
1 parent 2b56022 commit bee2344
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/quantcastBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const spec = {
*
*/
interpretResponse(serverResponse) {
const response = serverResponse;
const response = serverResponse['body'];

if (
response === undefined ||
Expand Down
13 changes: 11 additions & 2 deletions test/spec/modules/quantcastBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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();

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit bee2344

Please sign in to comment.