Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orbidder Bid Adapter : rename profile parameter to keyValues to match docs #10498

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions modules/orbidderBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { isFn, isPlainObject } from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { getStorageManager } from '../src/storageManager.js';
import { BANNER, NATIVE } from '../src/mediaTypes.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
import {getGlobal} from '../src/prebidGlobal.js';
import { getGlobal } from '../src/prebidGlobal.js';

const storageManager = getStorageManager({bidderCode: 'orbidder'});
const storageManager = getStorageManager({ bidderCode: 'orbidder' });

/**
* Determines whether or not the given bid response is valid.
Expand Down Expand Up @@ -69,7 +69,7 @@ export const spec = {
return !!(bid.sizes && bid.bidId && bid.params &&
(bid.params.accountId && (typeof bid.params.accountId === 'string')) &&
(bid.params.placementId && (typeof bid.params.placementId === 'string')) &&
((typeof bid.params.profile === 'undefined') || (typeof bid.params.profile === 'object')));
((typeof bid.params.keyValues === 'undefined') || (typeof bid.params.keyValues === 'object')));
},

/**
Expand Down
38 changes: 19 additions & 19 deletions test/spec/modules/orbidderBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {expect} from 'chai';
import {spec} from 'modules/orbidderBidAdapter.js';
import {newBidder} from 'src/adapters/bidderFactory.js';
import { expect } from 'chai';
import { spec } from 'modules/orbidderBidAdapter.js';
import { newBidder } from 'src/adapters/bidderFactory.js';
import * as _ from 'lodash';
import { BANNER, NATIVE } from '../../../src/mediaTypes.js';

Expand Down Expand Up @@ -59,7 +59,7 @@ describe('orbidderBidAdapter', () => {
}
};

const deepClone = function (val) {
const deepClone = function(val) {
return JSON.parse(JSON.stringify(val));
};

Expand Down Expand Up @@ -91,15 +91,15 @@ describe('orbidderBidAdapter', () => {
expect(spec.isBidRequestValid(defaultBidRequestNative)).to.equal(true);
});

it('banner: accepts optional profile object', () => {
it('banner: accepts optional keyValues object', () => {
const bidRequest = deepClone(defaultBidRequestBanner);
bidRequest.params.profile = {'key': 'value'};
bidRequest.params.keyValues = { 'key': 'value' };
expect(spec.isBidRequestValid(bidRequest)).to.equal(true);
});

it('native: accepts optional profile object', () => {
it('native: accepts optional keyValues object', () => {
const bidRequest = deepClone(defaultBidRequestNative);
bidRequest.params.profile = {'key': 'value'};
bidRequest.params.keyValues = { 'key': 'value' };
expect(spec.isBidRequestValid(bidRequest)).to.equal(true);
});

Expand All @@ -115,15 +115,15 @@ describe('orbidderBidAdapter', () => {
expect(spec.isBidRequestValid(bidRequest)).to.equal(false);
});

it('banner: doesn\'t accept malformed profile', () => {
it('banner: doesn\'t accept malformed keyValues', () => {
const bidRequest = deepClone(defaultBidRequestBanner);
bidRequest.params.profile = 'another not usable string';
bidRequest.params.keyValues = 'another not usable string';
expect(spec.isBidRequestValid(bidRequest)).to.equal(false);
});

it('native: doesn\'t accept malformed profile', () => {
it('native: doesn\'t accept malformed keyValues', () => {
const bidRequest = deepClone(defaultBidRequestNative);
bidRequest.params.profile = 'another not usable string';
bidRequest.params.keyValues = 'another not usable string';
expect(spec.isBidRequestValid(bidRequest)).to.equal(false);
});

Expand Down Expand Up @@ -347,7 +347,7 @@ describe('orbidderBidAdapter', () => {
}
];

const result = spec.interpretResponse({body: serverResponse});
const result = spec.interpretResponse({ body: serverResponse });
expect(result.length).to.equal(expectedResponse.length);
expect(_.isEqual(expectedResponse, serverResponse)).to.be.true;
});
Expand Down Expand Up @@ -387,7 +387,7 @@ describe('orbidderBidAdapter', () => {
}
];

const result = spec.interpretResponse({body: serverResponse});
const result = spec.interpretResponse({ body: serverResponse });

expect(result.length).to.equal(expectedResponse.length);
Object.keys(expectedResponse[0]).forEach((key) => {
Expand Down Expand Up @@ -454,7 +454,7 @@ describe('orbidderBidAdapter', () => {
}
];

const result = spec.interpretResponse({body: serverResponse});
const result = spec.interpretResponse({ body: serverResponse });

expect(result.length).to.equal(expectedResponse.length);
expect(_.isEqual(expectedResponse, serverResponse)).to.be.true;
Expand All @@ -474,7 +474,7 @@ describe('orbidderBidAdapter', () => {
'netRevenue': true,
}
];
const result = spec.interpretResponse({body: serverResponse});
const result = spec.interpretResponse({ body: serverResponse });
expect(result.length).to.equal(0);
});

Expand All @@ -492,7 +492,7 @@ describe('orbidderBidAdapter', () => {
'creativeId': '29681110',
}
];
const result = spec.interpretResponse({body: serverResponse});
const result = spec.interpretResponse({ body: serverResponse });
expect(result.length).to.equal(0);
});

Expand All @@ -518,13 +518,13 @@ describe('orbidderBidAdapter', () => {
}
}
];
const result = spec.interpretResponse({body: serverResponse});
const result = spec.interpretResponse({ body: serverResponse });
expect(result.length).to.equal(0);
});

it('handles nobid responses', () => {
const serverResponse = [];
const result = spec.interpretResponse({body: serverResponse});
const result = spec.interpretResponse({ body: serverResponse });
expect(result.length).to.equal(0);
});
});
Expand Down