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

Dummy PR to review approver acces #551

Open
wants to merge 28 commits into
base: nightly
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5a2f0ec
GPP config set to prebid
pm-nitin-shirsat Apr 4, 2023
af4a99b
Set GPP related config to prebid via OW
pm-nitin-shirsat Apr 5, 2023
97438ea
Add code to set gpp config to IDHUB
pm-nitin-shirsat Apr 7, 2023
55ebda4
Setting this config to PBJS_NAMESPACE as prebid needs to read consent…
pm-nitin-shirsat Apr 7, 2023
be872ac
Add gpp config to OW namespace in case of IH profiles
pm-nitin-shirsat Apr 11, 2023
0fa61c1
Merge pull request #440 from PubMatic/nightly
pm-nitin-shirsat Apr 19, 2023
6e261b1
Merge pull request #465 from PubMatic/nightly
pm-nitin-shirsat Jun 27, 2023
2b67026
Update init-build.sh
pm-nitin-shirsat Jun 29, 2023
a75cf03
Update init-build.sh
pm-nitin-shirsat Jun 29, 2023
4ec8328
Consuming buckets for custom PG
Mar 5, 2024
eb83d2d
Passing pwtpb with price bucket value to GAM
Mar 5, 2024
1a6a811
Added pwtpb in wrapper targetting keys
Mar 5, 2024
9ac2b1f
Updated the functionality as per changes in API side
Mar 15, 2024
679c3eb
Merge branch 'UOE-10115' into UOE-10005
Mar 15, 2024
8389bf4
Changing bidderSequence to random or fixed based on bidderOrderingEna…
kapil-tuptewar Jul 11, 2024
79bbe22
Merge branch 'nightly' into UOE-10005
Jul 26, 2024
aa01a3f
Updated test cases
Jul 26, 2024
6ac8393
Merge branch 'gpp/phase1/UOE-10929' into gpp-phase-1
pm-nitin-shirsat Aug 13, 2024
525307d
Merge pull request #546 from PubMatic/gpp-phase-1
pm-nitin-shirsat Aug 13, 2024
8ae915c
Added Support for GPP
pm-nitin-shirsat Aug 13, 2024
89ac7e2
Merge branch 'nightly' into UOE-10005
Aug 19, 2024
9b152bf
Merge branch 'nightly' into UOE-10675
kapil-tuptewar Aug 21, 2024
02281ba
Sync with nightly
pm-nitin-shirsat Aug 26, 2024
3525837
Sync with nightly
pm-nitin-shirsat Aug 26, 2024
e4128d8
Merge pull request #548 from PubMatic/nightly
pm-nitin-shirsat Aug 26, 2024
ecb045b
removed the pwtpb key from ignore list
Aug 27, 2024
ab5393c
Merge pull request #549 from PubMatic/bidder_ord_cpg
pm-azhar-mulla Aug 30, 2024
2340f52
Merge pull request #550 from PubMatic/gpp/phase1/UOE-10929
pm-nitin-shirsat Sep 5, 2024
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
2 changes: 1 addition & 1 deletion init-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ elif [ "$platform" = "$PLATFORM_AMP" ]
./build.sh --task=$task --mode=$mode
else
echo "None"
fi
fi
28 changes: 17 additions & 11 deletions src_new/adapters/prebid.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ var BID = require("../bid.js");
var util = require("../util.js");
var bidManager = require("../bidManager.js");
var CONF = require("../conf.js");

var COMMON_CONFIG = require("../common.config.js");


var parentAdapterID = CONSTANTS.COMMON.PARENT_ADAPTER_PREBID;

var pbNameSpace = /*CONFIG.isIdentityOnly() ? CONSTANTS.COMMON.IH_NAMESPACE : */ CONSTANTS.COMMON.PREBID_NAMESPACE;
Expand Down Expand Up @@ -857,6 +859,14 @@ function assignCcpaConfigIfRequired(prebidConfig){

exports.assignCcpaConfigIfRequired = assignCcpaConfigIfRequired;

function assignGppConfigIfRequired(prebidConfig) {
if (CONFIG.getGppConsent()) {
prebidConfig = COMMON_CONFIG.setConsentConfig(prebidConfig, "gpp", CONFIG.getGppCmpApi(), CONFIG.getGppTimeout());
}
}

exports.assignGppConfigIfRequired = assignGppConfigIfRequired;

function assignCurrencyConfigIfRequired(prebidConfig){
if(CONFIG.getAdServerCurrency()){
// get AdServer currency from Config
Expand Down Expand Up @@ -1017,7 +1027,7 @@ function setPrebidConfig(){
url: CONSTANTS.CONFIG.CACHE_URL + CONSTANTS.CONFIG.CACHE_PATH,
ignoreBidderCacheKey: true
},
bidderSequence: "random",
bidderSequence: CONF.pwt.bidderOrderingEnabled === "1" ? "fixed" : "random",
disableAjaxTimeout: CONFIG.getDisableAjaxTimeout(),
enableSendAllBids: CONFIG.getSendAllBidsStatus(),
targetingControls: {
Expand All @@ -1042,6 +1052,7 @@ function setPrebidConfig(){
refThis.assignUserSyncConfig(prebidConfig);
refThis.assignGdprConfigIfRequired(prebidConfig);
refThis.assignCcpaConfigIfRequired(prebidConfig);
refThis.assignGppConfigIfRequired(prebidConfig);
refThis.assignCurrencyConfigIfRequired(prebidConfig);
refThis.assignSchainConfigIfRequired(prebidConfig);
refThis.assignSingleRequestConfigForBidders(prebidConfig);
Expand All @@ -1065,15 +1076,6 @@ function setPrebidConfig(){

exports.setPrebidConfig = setPrebidConfig;

function realignPubmaticAdapters(){
if(CONF.adapters && CONF.adapters["pubmatic"]){
var pubmaticAdpater = {"pubmatic": CONF.adapters["pubmatic"]};
CONF.adapters = Object.assign(pubmaticAdpater, CONF.adapters);
}
}

exports.realignPubmaticAdapters = realignPubmaticAdapters;

function gets2sConfig(prebidConfig){
var bidderParams = {};
var s2sBidders = CONFIG.getServerEnabledAdaptars();
Expand Down Expand Up @@ -1320,6 +1322,11 @@ function getPbjsAdServerTargetingConfig(){
val: function(bidResponse){
return bidResponse.creativeId ? bidResponse.creativeId : '';
}
}, {
key: 'pwtpb',
val: function(bidResponse){
return bidResponse[CONSTANTS.PRICE_GRANULARITY_KEYS[owpbjs.readConfig('priceGranularity')]] || null;
}
}
];
}
Expand Down Expand Up @@ -1409,7 +1416,6 @@ function initPbjsConfig(){
return;
}
window[pbNameSpace].logging = util.isDebugLogEnabled();
refThis.realignPubmaticAdapters();
refThis.setPrebidConfig();
refThis.configureBidderAliasesIfAvailable();
refThis.enablePrebidPubMaticAnalyticIfRequired();
Expand Down
14 changes: 14 additions & 0 deletions src_new/common.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
// NOTE: This file will contains only common code/function used in OW and IDHUB.

var config = require("./conf.js");
var CONSTANTS = require("./constants.js");

exports.getGdprActionTimeout = function() {
var gdprActionTimeout = config[CONSTANTS.CONFIG.COMMON][CONSTANTS.CONFIG.GDPR_ACTION_TIMEOUT];
return gdprActionTimeout ? window.parseInt(gdprActionTimeout) : 0;
};

exports.setConsentConfig = function (prebidConfig, key, cmpApi, timeout) {
prebidConfig = prebidConfig || {};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 1 tab but found 2 spaces.

Suggested change
prebidConfig = prebidConfig || {};
prebidConfig = prebidConfig || {};

if (!prebidConfig["consentManagement"]) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 1 tab but found 2 spaces.

Suggested change
if (!prebidConfig["consentManagement"]) {
if (!prebidConfig["consentManagement"]) {

prebidConfig["consentManagement"] = {};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 2 tabs but found 4 spaces.

Suggested change
prebidConfig["consentManagement"] = {};
prebidConfig["consentManagement"] = {};

}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 1 tab but found 2 spaces.

Suggested change
}
}

prebidConfig["consentManagement"][key] = {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 1 tab but found 2 spaces.

Suggested change
prebidConfig["consentManagement"][key] = {
prebidConfig["consentManagement"][key] = {

cmpApi: cmpApi,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 2 tabs but found 4 spaces.

Suggested change
cmpApi: cmpApi,
cmpApi: cmpApi,

timeout: timeout
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 2 tabs but found 4 spaces.

Suggested change
timeout: timeout
timeout: timeout

};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 1 tab but found 2 spaces.

Suggested change
};
};

return prebidConfig;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 1 tab but found 2 spaces.

Suggested change
return prebidConfig;
return prebidConfig;

};
6 changes: 5 additions & 1 deletion src_new/conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ exports.pwt = {
abTestEnabled:"0",
pubAnalyticsAdapter: "0",
reduceCodeSize:1,
gpp: "0",
gppCmpApi: "iab",
gppTimeout: "10000",
pbGlobalVarNamespace: "owpbjs",
owGlobalVarNamespace: "PWT",
localStorageAccess: "1" // Added new field for allow local storage feature
localStorageAccess: "1", // Added new field for allow local storage feature
bidderOrderingEnabled: "0"
};

// singleImpression is used to enable feature of sending single impression for multiple size ad slot earlier there were multiple impression for multiple sizes
Expand Down
17 changes: 17 additions & 0 deletions src_new/config.idhub.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,23 @@ exports.getCCPATimeout = function() {
return ccpaTimeout ? window.parseInt(ccpaTimeout) : CONSTANTS.CONFIG.DEFAULT_CCPA_TIMEOUT;
};

// needed
exports.getGppConsent = function () {
var gpp = config[CONSTANTS.CONFIG.COMMON][CONSTANTS.CONFIG.GPP_CONSENT] || CONSTANTS.CONFIG.DEFAULT_GPP_CONSENT;
return gpp === "1";
};

// needed
exports.getGppCmpApi = function () {
return config[CONSTANTS.CONFIG.COMMON][CONSTANTS.CONFIG.GPP_CMPAPI] || CONSTANTS.CONFIG.DEFAULT_GPP_CMPAPI;
};

// needed
exports.getGppTimeout = function() {
var gppTimeout = config[CONSTANTS.CONFIG.COMMON][CONSTANTS.CONFIG.GPP_TIMEOUT];
return gppTimeout ? window.parseInt(gppTimeout) : CONSTANTS.CONFIG.DEFAULT_GPP_TIMEOUT;
};

exports.getProfileID = function () {
return config.pwt[CONSTANTS.CONFIG.PROFILE_ID] || "0";
};
Expand Down
43 changes: 42 additions & 1 deletion src_new/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,32 @@ exports.isReduceCodeSizeFeatureEnabled = function(){
// endRemoveIf(removeAlways)

exports.getPriceGranularity = function(){
return config[CONSTANTS.CONFIG.COMMON][CONSTANTS.COMMON.PRICE_GRANULARITY] || null;
var priceGranularity = config[CONSTANTS.CONFIG.COMMON][CONSTANTS.COMMON.PRICE_GRANULARITY] || null;

if (priceGranularity === CONSTANTS.COMMON.PRICE_GRANULARITY_CUSTOM) {
var bucketsValue = refThis.getPriceGranularityBuckets();
if(bucketsValue !== null) {
return bucketsValue;
} else {
util.logWarning(CONSTANTS.MESSAGES.M36);
return null;
}
}
else {
return priceGranularity;
}
};

exports.getPriceGranularityBuckets = function () {
var pgBuckets = config[CONSTANTS.CONFIG.COMMON][CONSTANTS.COMMON.PRICE_GRANULARITY_BUCKETS] || null;
if(pgBuckets === null)
return null;

// API would be providing us with ranges as keyword, we need to raplace it by buckets before processing
var transformedBuckets = {};
delete Object.assign(transformedBuckets, pgBuckets, {['buckets']: pgBuckets['ranges'] })['ranges'];

return transformedBuckets;
};

exports.getGranularityMultiplier = function(){
Expand Down Expand Up @@ -459,6 +484,22 @@ exports.getMarketplaceBidders = function(){
return config.pwt.marketplaceBidders ? config.pwt.marketplaceBidders.split(',') : false;
}


exports.getGppConsent = function () {
var gpp = config[CONSTANTS.CONFIG.COMMON][CONSTANTS.CONFIG.GPP_CONSENT] || CONSTANTS.CONFIG.DEFAULT_GPP_CONSENT;
return gpp === "1";
};

exports.getGppCmpApi = function () {
return config[CONSTANTS.CONFIG.COMMON][CONSTANTS.CONFIG.GPP_CMPAPI] || CONSTANTS.CONFIG.DEFAULT_GPP_CMPAPI;
};

exports.getGppTimeout = function () {
var gppTimeout = config[CONSTANTS.CONFIG.COMMON][CONSTANTS.CONFIG.GPP_TIMEOUT];
return gppTimeout ? window.parseInt(gppTimeout) : CONSTANTS.CONFIG.DEFAULT_GPP_TIMEOUT;
}

exports.shouldClearTargeting = function () {
return window.PWT.shouldClearTargeting !== undefined ? Boolean(window.PWT.shouldClearTargeting) : true;

};
21 changes: 20 additions & 1 deletion src_new/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ exports.COMMON = {
"TEST_GROUP_DETAILS": "testConfigDetails",
"TEST_PWT": "test_pwt",
"PRICE_GRANULARITY" : "priceGranularity",
"PRICE_GRANULARITY_CUSTOM" : "custom",
"PRICE_GRANULARITY_BUCKETS" : "customPriceGranularityConfig",
"GRANULARITY_MULTIPLIER" : "granularityMultiplier",
"TEST_PARTNER": "test_adapters",
"REDUCE_CODE_SIZE": "reduceCodeSize",
Expand Down Expand Up @@ -112,6 +114,12 @@ exports.CONFIG = {
"TIMEOUT_ADJUSTMENT": 50,
"SSO_ENABLED": "ssoEnabled",
"FLOOR_SOURCE": "floorSource",
"GPP_CONSENT": "gpp",
"GPP_CMPAPI": "gppCmpApi",
"GPP_TIMEOUT": "gppTimeout",
"DEFAULT_GPP_CONSENT": "0",
"DEFAULT_GPP_CMPAPI": "iab",
"DEFAULT_GPP_TIMEOUT": 10000,
"GDPR_ACTION_TIMEOUT": "gdprActionTimeout",
"PB_GLOBAL_VAR_NAMESPACE": "pbGlobalVarNamespace",
"OW_GLOBAL_VAR_NAMESPACE": "owGlobalVarNamespace"
Expand Down Expand Up @@ -161,7 +169,8 @@ exports.WRAPPER_TARGETING_KEYS = {
"CACHE_PATH": "pwtcpath",
"ACAT": "pwtacat",
"CRID": "pwtcrid",
"DSP": "pwtdsp"
"DSP": "pwtdsp",
"PRICE_BUCKET": "pwtpb"
};

exports.IGNORE_PREBID_KEYS = {
Expand Down Expand Up @@ -220,6 +229,7 @@ exports.MESSAGES = {
"M33": "AdUnitsArray response should be an array.",
"M34": "Invalid HTML Element selected for ad rendering.",
"M35": "Winning bid not found for Div Id :",
"M36": "Price Buckets should be set for custom price granularity",
IDENTITY: {
M1: "Unable to get User Id from OpenIdentity",
M2: "Setting UserIds to EB ",
Expand Down Expand Up @@ -358,3 +368,12 @@ exports.REGEX_BROWSERS = [/\b(?:crmo|crios)\/([\w\.]+)/i,/edg(?:e|ios|a)?\/([\w\
/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i];
exports.BROWSER_MAPPING = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,
65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90];

exports.PRICE_GRANULARITY_KEYS = {
auto: "pbAg",
dense: "pbDg",
low: "pbLg",
medium: "pbMg",
high:"pbHg",
custom: "pbCg"
};
2 changes: 1 addition & 1 deletion src_new/controllers/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function findWinningBidAndGenerateTargeting(divId) {
util.forEachOnObject(keyValuePairs, function(key) {
// if winning bid is not pubmatic then remove buyId targeting key. Ref : UOE-5277
/* istanbul ignore else*/
if (util.isOwnProperty(ignoreTheseKeys, key) || util.isOwnProperty({"pwtpb":1}, key) || (winningBid && winningBid.adapterID !== "pubmatic" && util.isOwnProperty({"hb_buyid_pubmatic":1,"pwtbuyid_pubmatic":1}, key))) {
if (util.isOwnProperty(ignoreTheseKeys, key) || (winningBid && winningBid.adapterID !== "pubmatic" && util.isOwnProperty({"hb_buyid_pubmatic":1,"pwtbuyid_pubmatic":1}, key))) {
delete keyValuePairs[key];
}
else {
Expand Down
2 changes: 1 addition & 1 deletion src_new/controllers/gpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function findWinningBidAndApplyTargeting(divID, parentArgs) { // TDD, i/o : done
delete keyValuePairs[key];
}
/* istanbul ignore else*/
else if (!util.isOwnProperty(ignoreTheseKeys, key) && !util.isOwnProperty({"pwtpb":1}, key)) {
else if (!util.isOwnProperty(ignoreTheseKeys, key)) {
googleDefinedSlot.setTargeting(key, value);
// adding key in wrapperTargetingKeys as every key added by OpenWrap should be removed before calling refresh on slot
refThis.defineWrapperTargetingKey(key);
Expand Down
8 changes: 8 additions & 0 deletions src_new/controllers/idhub.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
var CONFIG = require("../config.idhub.js");
var CONSTANTS = require("../constants.js");
var util = require("../util.idhub.js");

var COMMON_CONFIG = require("../common.config.js");

var refThis = this;
var pbNameSpace = CONFIG.isIdentityOnly() ? CONSTANTS.COMMON.IH_NAMESPACE : CONSTANTS.COMMON.PREBID_NAMESPACE;

Expand Down Expand Up @@ -64,6 +66,12 @@ refThis.setConfig = function(){
timeout: CONFIG.getCCPATimeout(),
};
}

// Set Gpp consent config
if (CONFIG.getGppConsent()) {
prebidConfig = COMMON_CONFIG.setConsentConfig(prebidConfig, "gpp", CONFIG.getGppCmpApi(), CONFIG.getGppTimeout());
}

window.IHPWT.ssoEnabled = CONFIG.isSSOEnabled() || false;
if(CONFIG.isUserIdModuleEnabled()){
prebidConfig["userSync"]["userIds"] = util.getUserIdConfiguration();
Expand Down
61 changes: 47 additions & 14 deletions test/adapters/prebid.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,10 @@ describe('ADAPTER: Prebid', function() {
sinon.spy(CONFIG, 'getCCPATimeout');
sinon.stub(CONFIG, 'getCCPA').returns(true);

sinon.spy(CONFIG, 'getGppTimeout');
sinon.spy(CONFIG, 'getGppCmpApi');
sinon.stub(CONFIG, 'getGppConsent').returns(true);

sinon.stub(BM, 'resetBid', function(){});
sinon.stub(BM, 'setSizes', function(){});

Expand Down Expand Up @@ -1362,6 +1366,10 @@ describe('ADAPTER: Prebid', function() {
CONFIG.getCCPA.restore();
CONFIG.getCCPATimeout.restore();

CONFIG.getGppConsent.restore();
CONFIG.getGppCmpApi.restore();
CONFIG.getGppTimeout.restore();

BM.resetBid.restore();
BM.setSizes.restore();

Expand Down Expand Up @@ -1433,6 +1441,9 @@ describe('ADAPTER: Prebid', function() {
CONFIG.getCCPA().should.be.true;
CONFIG.getCCPACmpApi().should.be.called;
CONFIG.getCCPATimeout().should.be.called;
CONFIG.getGppConsent().should.be.true;
CONFIG.getGppCmpApi().should.be.called;
CONFIG.getGppTimeout().should.be.called;
done();
});

Expand Down Expand Up @@ -2116,20 +2127,6 @@ describe('ADAPTER: Prebid', function() {
expect(response).to.deep.equal(outputObj);
done();
});
})

describe('realignPubmaticAdapters', function() {
it('should be a functiion',function(done){
PREBID.realignPubmaticAdapters.should.be.a('function');
done();
});
it('should realignPubmaticAdapters', function(done) {
PREBID.realignPubmaticAdapters();
expect(CONF.adapters['pubmatic']).should.have.object;
expect(CONF.adapters['pubmatic']).to.be.an('object');
expect(CONF.adapters['pubmatic']).to.have.property('throttle');
done();
});
});

describe('getPbjsAdServerTargetingConfig', function() {
Expand Down Expand Up @@ -2250,4 +2247,40 @@ describe('ADAPTER: Prebid', function() {
done();
});
})

describe('dynamicBidderOrdering', function() {
let originalOwPbJs;
let mockSetConfig;
beforeEach(() => {
// Save the original owpbjs and setConfig function
originalOwPbJs = window['owpbjs'];
mockSetConfig = sinon.spy();
window['owpbjs'] = {
setConfig: mockSetConfig,
};
})

afterEach(() => {
// Restore the original owpbjs
window['owpbjs'] = originalOwPbJs;
CONF.pwt.bidderOrderingEnabled = '0';
});

it('should set bidderSequence to random when dynamic bidder ordering is disabled', function(done) {
PREBID.setPrebidConfig();
expect(mockSetConfig.calledOnce).to.be.true;
const configArg = mockSetConfig.getCall(0).args[0];
expect(configArg).to.have.property('bidderSequence', 'random');
done();
});

it('should set bidderSequence to fixed when dynamic bidder ordering is enabled', function(done) {
CONF.pwt.bidderOrderingEnabled = '1';
PREBID.setPrebidConfig();
expect(mockSetConfig.calledOnce).to.be.true;
const configArg = mockSetConfig.getCall(0).args[0];
expect(configArg).to.have.property('bidderSequence', 'fixed');
done();
});
})
});
Loading