Skip to content

Commit

Permalink
weborama: remove appnexus specific handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi committed Jun 12, 2023
1 parent 736b20f commit d6450d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 94 deletions.
35 changes: 8 additions & 27 deletions modules/weboramaRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,34 +94,25 @@
* @typedef {WeboCtxConf|WeboUserDataConf|SfbxLiteDataConf} CommonConf
*/

import {
getGlobal
} from '../src/prebidGlobal.js';
import {getGlobal} from '../src/prebidGlobal.js';
import {
deepClone,
deepSetValue,
isArray,
isBoolean,
isEmpty,
isFn,
isPlainObject,
isStr,
logError,
logMessage,
isArray,
isStr,
isBoolean,
isPlainObject,
logWarn,
mergeDeep,
tryAppendQueryString
} from '../src/utils.js';
import {
submodule
} from '../src/hook.js';
import {
ajax
} from '../src/ajax.js';
import {
getStorageManager
} from '../src/storageManager.js';
import adapterManager from '../src/adapterManager.js';
import {submodule} from '../src/hook.js';
import {ajax} from '../src/ajax.js';
import {getStorageManager} from '../src/storageManager.js';
import {MODULE_TYPE_RTD} from '../src/activities/modules.js';

/** @type {string} */
Expand Down Expand Up @@ -682,16 +673,6 @@ class WeboramaRtdProvider {
// eslint-disable-next-line no-dupe-class-members
#handleBid(reqBidsConfigObj, bid, profile, metadata) {
this.#handleBidViaORTB2(reqBidsConfigObj, bid.bidder, profile, metadata);

/** @type {Object.<string,string>} */
const bidderAliasRegistry = adapterManager.aliasRegistry || {};

/** @type {string} */
const bidder = bidderAliasRegistry[bid.bidder] || bid.bidder;

if (bidder == 'appnexus') {
this.#handleAppnexusBid(reqBidsConfigObj, bid, profile);
}
}

/** function that handles bid request data
Expand Down
70 changes: 3 additions & 67 deletions test/spec/modules/weboramaRtdProvider_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,7 @@ describe('weboramaRtdProvider', function() {
});

expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
expect(reqBidsConfigObj.adUnits[0].bids[0].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[1].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(data);
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids.find((bid) => bid.params)).to.not.exist;
['smartadserver', 'pubmatic', 'appnexus', 'rubicon', 'other'].forEach((v) => {
expect(reqBidsConfigObj.ortb2Fragments.bidder[v]).to.deep.equal({
site: {
Expand Down Expand Up @@ -217,10 +214,7 @@ describe('weboramaRtdProvider', function() {
});

expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
expect(reqBidsConfigObj.adUnits[0].bids[0].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[1].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(data);
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids.find((bid) => bid.params)).to.not.exist;
['smartadserver', 'pubmatic', 'appnexus', 'rubicon', 'other'].forEach((v) => {
expect(reqBidsConfigObj.ortb2Fragments.bidder[v]).to.deep.equal({
site: {
Expand Down Expand Up @@ -303,11 +297,7 @@ describe('weboramaRtdProvider', function() {
'adunit1': data,
});

expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
expect(reqBidsConfigObj.adUnits[0].bids[0].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[1].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(data);
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids.find((bid) => bid.params)).to.not.exist;
['smartadserver', 'pubmatic', 'appnexus', 'rubicon', 'other'].forEach((v) => {
expect(reqBidsConfigObj.ortb2Fragments.bidder[v]).to.deep.equal({
site: {
Expand Down Expand Up @@ -539,10 +529,6 @@ describe('weboramaRtdProvider', function() {

reqBidsConfigObj.adUnits.forEach(adUnit => {
expect(adUnit.bids.length).to.equal(5);
expect(adUnit.bids[0].params).to.be.undefined;
expect(adUnit.bids[1].params).to.be.undefined;
expect(adUnit.bids[2].params.keywords).to.deep.equal(data);
expect(adUnit.bids[3].params).to.be.undefined;
});
['smartadserver', 'pubmatic', 'appnexus', 'rubicon', 'other'].forEach((v) => {
if (v == 'appnexus') {
Expand Down Expand Up @@ -665,15 +651,8 @@ describe('weboramaRtdProvider', function() {

reqBidsConfigObj.adUnits.forEach(adUnit => {
expect(adUnit.bids.length).to.equal(5);
expect(adUnit.bids[0].params).to.be.undefined;
expect(adUnit.bids[1].params).to.be.undefined;
expect(adUnit.bids[3].params).to.be.undefined;
expect(adUnit.bids[4].ortb2).to.be.undefined;
});

expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(data);
expect(reqBidsConfigObj.adUnits[1].bids[2].params).to.be.undefined;

expect(onDataResponse).to.deep.equal({
data: data,
meta: {
Expand Down Expand Up @@ -811,9 +790,6 @@ describe('weboramaRtdProvider', function() {
expect(adUnit.bids.length).to.equal(5);
expect(adUnit.bids[0].params.target).to.equal('foo=bar');
expect(adUnit.bids[1].params.dctr).to.equal('foo=bar');
expect(adUnit.bids[2].params.keywords).to.deep.equal({
foo: ['bar']
});
expect(adUnit.bids[3].params).to.deep.equal({
inventory: {
foo: 'bar',
Expand Down Expand Up @@ -1122,11 +1098,6 @@ describe('weboramaRtdProvider', function() {
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
expect(reqBidsConfigObj.adUnits[0].bids[0].params.target).to.equal('foo=bar');
expect(reqBidsConfigObj.adUnits[0].bids[1].params.dctr).to.equal('foo=bar');
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal({
foo: ['bar'],
webo_ctx: ['foo', 'bar'],
webo_ds: ['baz'],
});
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.deep.equal({
inventory: {
foo: 'bar',
Expand Down Expand Up @@ -1213,7 +1184,6 @@ describe('weboramaRtdProvider', function() {
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
expect(reqBidsConfigObj.adUnits[0].bids[0].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[1].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(defaultProfile);
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.be.undefined;
['smartadserver', 'pubmatic', 'appnexus', 'rubicon', 'other'].forEach((v) => {
expect(reqBidsConfigObj.ortb2Fragments.bidder[v]).to.deep.equal({
Expand Down Expand Up @@ -1360,12 +1330,6 @@ describe('weboramaRtdProvider', function() {
}
});
})
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal({
webo_ctx: ['foo', 'bar'],
webo_ds: ['baz'],
webo_bar: ['baz'],
});
expect(reqBidsConfigObj.adUnits[1].bids[2].params.keywords).to.deep.equal(data);

expect(onDataResponse).to.deep.equal({
data: data,
Expand Down Expand Up @@ -1446,7 +1410,6 @@ describe('weboramaRtdProvider', function() {
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
expect(reqBidsConfigObj.adUnits[0].bids[0].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[1].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(data);
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.be.undefined;
['smartadserver', 'pubmatic', 'appnexus', 'rubicon', 'other'].forEach((v) => {
expect(reqBidsConfigObj.ortb2Fragments.bidder[v]).to.deep.equal({
Expand Down Expand Up @@ -1572,7 +1535,6 @@ describe('weboramaRtdProvider', function() {
expect(adUnit.bids.length).to.equal(5);
expect(adUnit.bids[0].params).to.be.undefined;
expect(adUnit.bids[1].params).to.be.undefined;
expect(adUnit.bids[2].params.keywords).to.deep.equal(data);
expect(adUnit.bids[3].params).to.be.undefined;
});
['smartadserver', 'pubmatic', 'appnexus', 'rubicon', 'other'].forEach((v) => {
Expand Down Expand Up @@ -1716,7 +1678,6 @@ describe('weboramaRtdProvider', function() {
expect(reqBidsConfigObj.ortb2Fragments.bidder[v]).to.be.undefined;
})

expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(data);
expect(reqBidsConfigObj.adUnits[1].bids[2].params).to.be.undefined;

expect(onDataResponse).to.deep.equal({
Expand Down Expand Up @@ -2172,11 +2133,6 @@ describe('weboramaRtdProvider', function() {
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
expect(reqBidsConfigObj.adUnits[0].bids[0].params.target).to.equal('foo=bar');
expect(reqBidsConfigObj.adUnits[0].bids[1].params.dctr).to.equal('foo=bar');
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal({
foo: ['bar'],
webo_cs: ['foo', 'bar'],
webo_audiences: ['baz'],
});
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.deep.equal({
inventory: {
foo: 'bar',
Expand Down Expand Up @@ -2250,7 +2206,6 @@ describe('weboramaRtdProvider', function() {
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
expect(reqBidsConfigObj.adUnits[0].bids[0].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[1].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(defaultProfile);
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.be.undefined;
['smartadserver', 'pubmatic', 'appnexus', 'rubicon', 'other'].forEach((v) => {
expect(reqBidsConfigObj.ortb2Fragments.bidder[v]).to.deep.equal({
Expand Down Expand Up @@ -2324,7 +2279,6 @@ describe('weboramaRtdProvider', function() {
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
expect(reqBidsConfigObj.adUnits[0].bids[0].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[1].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(defaultProfile);
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.be.undefined;
['smartadserver', 'pubmatic', 'appnexus', 'rubicon', 'other'].forEach((v) => {
expect(reqBidsConfigObj.ortb2Fragments.bidder[v]).to.deep.equal({
Expand Down Expand Up @@ -2552,7 +2506,6 @@ describe('weboramaRtdProvider', function() {
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
expect(reqBidsConfigObj.adUnits[0].bids[0].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[1].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(data);
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.be.undefined;
['smartadserver', 'pubmatic', 'appnexus', 'rubicon', 'other'].forEach((v) => {
expect(reqBidsConfigObj.ortb2Fragments.bidder[v]).to.deep.equal({
Expand Down Expand Up @@ -2677,7 +2630,6 @@ describe('weboramaRtdProvider', function() {
expect(adUnit.bids.length).to.equal(5);
expect(adUnit.bids[0].params).to.be.undefined;
expect(adUnit.bids[1].params).to.be.undefined;
expect(adUnit.bids[2].params.keywords).to.deep.equal(data);
expect(adUnit.bids[3].params).to.be.undefined;
});
['smartadserver', 'pubmatic', 'appnexus', 'rubicon', 'other'].forEach((v) => {
Expand Down Expand Up @@ -2806,7 +2758,6 @@ describe('weboramaRtdProvider', function() {
expect(adUnit.bids[3].params).to.be.undefined;
});

expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(data);
expect(reqBidsConfigObj.adUnits[1].bids[2].params).to.be.undefined;

['smartadserver', 'pubmatic', 'appnexus', 'rubicon', 'other'].forEach((v) => {
Expand Down Expand Up @@ -3278,11 +3229,6 @@ describe('weboramaRtdProvider', function() {
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
expect(reqBidsConfigObj.adUnits[0].bids[0].params.target).to.equal('foo=bar');
expect(reqBidsConfigObj.adUnits[0].bids[1].params.dctr).to.equal('foo=bar');
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal({
foo: ['bar'],
lite_occupation: ['gérant', 'bénévole'],
lite_hobbies: ['sport', 'cinéma'],
});
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.deep.equal({
inventory: {
foo: 'bar',
Expand Down Expand Up @@ -3355,7 +3301,6 @@ describe('weboramaRtdProvider', function() {
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
expect(reqBidsConfigObj.adUnits[0].bids[0].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[1].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(defaultProfile);
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.be.undefined;
['smartadserver', 'pubmatic', 'appnexus', 'rubicon', 'other'].forEach((v) => {
expect(reqBidsConfigObj.ortb2Fragments.bidder[v]).to.deep.equal({
Expand Down Expand Up @@ -3428,7 +3373,6 @@ describe('weboramaRtdProvider', function() {
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
expect(reqBidsConfigObj.adUnits[0].bids[0].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[1].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(defaultProfile);
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.be.undefined;
expect(reqBidsConfigObj.ortb2Fragments.bidder.other).to.deep.equal({
site: {
Expand Down Expand Up @@ -3515,7 +3459,6 @@ describe('weboramaRtdProvider', function() {
expect(reqBidsConfigObj.adUnits[0].bids.length).to.equal(5);
expect(reqBidsConfigObj.adUnits[0].bids[0].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[1].params).to.be.undefined;
expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal(defaultProfile);
expect(reqBidsConfigObj.adUnits[0].bids[3].params).to.be.undefined;
['smartadserver', 'pubmatic', 'appnexus', 'rubicon', 'other'].forEach((v) => {
expect(reqBidsConfigObj.ortb2Fragments.bidder[v]).to.deep.equal({
Expand Down Expand Up @@ -3663,13 +3606,6 @@ describe('weboramaRtdProvider', function() {
});
})

expect(reqBidsConfigObj.adUnits[0].bids[2].params.keywords).to.deep.equal({
lite_occupation: ['gérant', 'bénévole'],
lite_hobbies: ['sport', 'cinéma'],
lito_bar: ['baz'],
});
expect(reqBidsConfigObj.adUnits[1].bids[2].params.keywords).to.deep.equal(data);

expect(onDataResponse).to.deep.equal({
data: data,
meta: {
Expand Down

0 comments on commit d6450d1

Please sign in to comment.