From 4058b9a0c73f5d26c81374067b0c7c944ed09d1d Mon Sep 17 00:00:00 2001 From: MaksymTeqBlaze Date: Fri, 3 Apr 2026 16:12:56 +0300 Subject: [PATCH 1/4] added ts for teqblaze utils and some fixes --- libraries/teqblazeUtils/bidderUtils.js | 269 ------------- libraries/teqblazeUtils/bidderUtils.ts | 372 ++++++++++++++++++ .../teqblazeUtils/bidderUtils_spec.js | 30 +- .../spec/modules/360playvidBidAdapter_spec.js | 23 +- test/spec/modules/acuityadsBidAdapter_spec.js | 72 +--- test/spec/modules/adprimeBidAdapter_spec.js | 20 +- .../modules/ads_interactiveBidAdapter_spec.js | 23 +- .../modules/appStockSSPBidAdapter_spec.js | 25 +- test/spec/modules/appushBidAdapter_spec.js | 14 +- test/spec/modules/axisBidAdapter_spec.js | 20 +- .../modules/beyondmediaBidAdapter_spec.js | 20 +- test/spec/modules/bidfuseBidAdapter_spec.js | 17 +- test/spec/modules/boldwinBidAdapter_spec.js | 20 +- .../modules/colossussspBidAdapter_spec.js | 13 +- test/spec/modules/compassBidAdapter_spec.js | 23 +- .../modules/contentexchangeBidAdapter_spec.js | 23 +- test/spec/modules/contxtfulBidAdapter_spec.js | 3 +- .../spec/modules/copper6sspBidAdapter_spec.js | 23 +- test/spec/modules/dpaiBidAdapter_spec.js | 23 +- .../spec/modules/e_volutionBidAdapter_spec.js | 17 +- test/spec/modules/edge226BidAdapter_spec.js | 17 +- test/spec/modules/emtvBidAdapter_spec.js | 23 +- test/spec/modules/harionBidAdapter_spec.js | 17 +- test/spec/modules/iqzoneBidAdapter_spec.js | 23 +- test/spec/modules/kiviadsBidAdapter_spec.js | 23 +- .../spec/modules/krushmediaBidAdapter_spec.js | 23 +- test/spec/modules/loyalBidAdapter_spec.js | 17 +- .../modules/lunamediahbBidAdapter_spec.js | 20 +- .../modules/mathildeadsBidAdapter_spec.js | 20 +- test/spec/modules/mgidXBidAdapter_spec.js | 17 +- test/spec/modules/mobfoxpbBidAdapter_spec.js | 17 +- .../modules/mycodemediaBidAdapter_spec.js | 23 +- test/spec/modules/nubaBidAdapter_spec.js | 17 +- test/spec/modules/orakiBidAdapter_spec.js | 23 +- test/spec/modules/pgamsspBidAdapter_spec.js | 23 +- test/spec/modules/pinkLionBidAdapter_spec.js | 17 +- test/spec/modules/playdigoBidAdapter_spec.js | 17 +- test/spec/modules/pubCircleBidAdapter_spec.js | 20 +- test/spec/modules/pubriseBidAdapter_spec.js | 23 +- test/spec/modules/qtBidAdapter_spec.js | 23 +- test/spec/modules/rocketlabBidAdapter_spec.js | 19 +- .../spec/modules/screencoreBidAdapter_spec.js | 8 +- test/spec/modules/smarthubBidAdapter_spec.js | 18 +- test/spec/modules/smootBidAdapter_spec.js | 19 +- .../teqBlazeSalesAgentBidAdapter_spec.js | 14 +- test/spec/modules/verbenBidAdapter_spec.js | 17 +- .../modules/visiblemeasuresBidAdapter_spec.js | 23 +- 47 files changed, 772 insertions(+), 799 deletions(-) delete mode 100644 libraries/teqblazeUtils/bidderUtils.js create mode 100644 libraries/teqblazeUtils/bidderUtils.ts diff --git a/libraries/teqblazeUtils/bidderUtils.js b/libraries/teqblazeUtils/bidderUtils.js deleted file mode 100644 index f57cb30ffa7..00000000000 --- a/libraries/teqblazeUtils/bidderUtils.js +++ /dev/null @@ -1,269 +0,0 @@ -import { BANNER, NATIVE, VIDEO } from '../../src/mediaTypes.js'; - -import { config } from '../../src/config.js'; - -const PROTOCOL_PATTERN = /^[a-z0-9.+-]+:/i; - -const isBidResponseValid = (bid) => { - if (!bid.requestId || !bid.cpm || !bid.creativeId || !bid.ttl || !bid.currency) { - return false; - } - - switch (bid.mediaType) { - case BANNER: - return Boolean(bid.width && bid.height && bid.ad); - case VIDEO: - return Boolean(bid.vastUrl || bid.vastXml); - case NATIVE: - return Boolean(bid.native && bid.native.impressionTrackers && bid.native.impressionTrackers.length); - default: - return false; - } -}; - -const getBidFloor = (bid) => { - try { - const bidFloor = bid.getFloor({ - currency: 'USD', - mediaType: '*', - size: '*', - }); - - return bidFloor?.floor; - } catch (err) { - return 0; - } -}; - -const createBasePlacement = (bid, bidderRequest) => { - const { bidId, mediaTypes, transactionId, userIdAsEids, ortb2Imp } = bid; - const schain = bidderRequest?.ortb2?.source?.ext?.schain || {}; - const bidfloor = getBidFloor(bid); - - const placement = { - bidId, - schain, - bidfloor - }; - - if (mediaTypes && mediaTypes[BANNER]) { - placement.adFormat = BANNER; - placement.sizes = mediaTypes[BANNER].sizes; - } else if (mediaTypes && mediaTypes[VIDEO]) { - placement.adFormat = VIDEO; - placement.playerSize = mediaTypes[VIDEO].playerSize; - placement.minduration = mediaTypes[VIDEO].minduration; - placement.maxduration = mediaTypes[VIDEO].maxduration; - placement.mimes = mediaTypes[VIDEO].mimes; - placement.protocols = mediaTypes[VIDEO].protocols; - placement.startdelay = mediaTypes[VIDEO].startdelay; - placement.placement = mediaTypes[VIDEO].placement; - placement.plcmt = mediaTypes[VIDEO].plcmt; - placement.skip = mediaTypes[VIDEO].skip; - placement.skipafter = mediaTypes[VIDEO].skipafter; - placement.minbitrate = mediaTypes[VIDEO].minbitrate; - placement.maxbitrate = mediaTypes[VIDEO].maxbitrate; - placement.delivery = mediaTypes[VIDEO].delivery; - placement.playbackmethod = mediaTypes[VIDEO].playbackmethod; - placement.api = mediaTypes[VIDEO].api; - placement.linearity = mediaTypes[VIDEO].linearity; - } else if (mediaTypes && mediaTypes[NATIVE]) { - placement.native = mediaTypes[NATIVE]; - placement.adFormat = NATIVE; - } - - if (transactionId) { - placement.ext = placement.ext || {}; - placement.ext.tid = transactionId; - } - - if (userIdAsEids && userIdAsEids.length) { - placement.eids = userIdAsEids; - } - - if (ortb2Imp?.ext?.gpid) { - placement.gpid = ortb2Imp.ext.gpid; - } - - return placement; -}; - -const defaultPlacementType = (bid, bidderRequest, placement) => { - const { placementId, endpointId } = bid.params; - - if (placementId) { - placement.placementId = placementId; - placement.type = 'publisher'; - } else if (endpointId) { - placement.endpointId = endpointId; - placement.type = 'network'; - } -}; - -const checkIfObjectHasKey = (keys, obj, mode = 'some') => { - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const val = obj[key]; - - if (mode === 'some' && val) return true; - if (mode === 'every' && !val) return false; - } - - return mode === 'every'; -} - -export const isBidRequestValid = (keys = ['placementId', 'endpointId'], mode) => (bid = {}) => { - const { params, bidId, mediaTypes } = bid; - let valid = Boolean(bidId && params && checkIfObjectHasKey(keys, params, mode)); - - if (mediaTypes && mediaTypes[BANNER]) { - valid = valid && Boolean(mediaTypes[BANNER] && mediaTypes[BANNER].sizes); - } else if (mediaTypes && mediaTypes[VIDEO]) { - valid = valid && Boolean(mediaTypes[VIDEO] && mediaTypes[VIDEO].playerSize); - } else if (mediaTypes && mediaTypes[NATIVE]) { - valid = valid && Boolean(mediaTypes[NATIVE]); - } else { - valid = false; - } - - return valid; -}; - -/** - * @param {{ adUrl, validBidRequests, bidderRequest, placementProcessingFunction }} config - * @returns {function} - */ -export const buildRequestsBase = (config) => { - const { adUrl, validBidRequests, bidderRequest } = config; - const placementProcessingFunction = config.placementProcessingFunction || buildPlacementProcessingFunction(); - const device = bidderRequest?.ortb2?.device; - const page = bidderRequest?.refererInfo?.page || ''; - - const proto = PROTOCOL_PATTERN.exec(page); - const protocol = proto?.[0]; - - const placements = []; - const request = { - deviceWidth: device?.w || 0, - deviceHeight: device?.h || 0, - language: device?.language?.split('-')[0] || '', - secure: protocol === 'https:' ? 1 : 0, - host: bidderRequest?.refererInfo?.domain || '', - page, - placements, - coppa: bidderRequest?.ortb2?.regs?.coppa ? 1 : 0, - tmax: bidderRequest.timeout, - bcat: bidderRequest?.ortb2?.bcat, - badv: bidderRequest?.ortb2?.badv, - bapp: bidderRequest?.ortb2?.bapp, - battr: bidderRequest?.ortb2?.battr - }; - - if (bidderRequest.uspConsent) { - request.ccpa = bidderRequest.uspConsent; - } - - if (bidderRequest.gdprConsent) { - request.gdpr = { - consentString: bidderRequest.gdprConsent.consentString - }; - } - - if (bidderRequest.gppConsent) { - request.gpp = bidderRequest.gppConsent.gppString; - request.gpp_sid = bidderRequest.gppConsent.applicableSections; - } else if (bidderRequest.ortb2?.regs?.gpp) { - request.gpp = bidderRequest.ortb2.regs.gpp; - request.gpp_sid = bidderRequest.ortb2.regs.gpp_sid; - } - - if (bidderRequest?.ortb2?.device) { - request.device = bidderRequest.ortb2.device; - } - - const len = validBidRequests.length; - for (let i = 0; i < len; i++) { - const bid = validBidRequests[i]; - placements.push(placementProcessingFunction(bid, bidderRequest)); - } - - return { - method: 'POST', - url: adUrl, - data: request - }; -}; - -export const buildRequests = (adUrl) => (validBidRequests = [], bidderRequest = {}) => { - const placementProcessingFunction = buildPlacementProcessingFunction(); - - return buildRequestsBase({ adUrl, validBidRequests, bidderRequest, placementProcessingFunction }); -}; - -export function interpretResponseBuilder({ addtlBidValidation = (bid) => true } = {}) { - return function (serverResponse) { - const response = []; - for (let i = 0; i < serverResponse.body.length; i++) { - const resItem = serverResponse.body[i]; - if (isBidResponseValid(resItem) && addtlBidValidation(resItem)) { - const advertiserDomains = resItem.adomain && resItem.adomain.length ? resItem.adomain : []; - resItem.meta = { ...resItem.meta, advertiserDomains }; - - response.push(resItem); - } - } - - return response; - } -} - -export const interpretResponse = interpretResponseBuilder(); - -export const getUserSyncs = (syncUrl) => (syncOptions, serverResponses, gdprConsent, uspConsent, gppConsent) => { - const type = syncOptions.iframeEnabled ? 'iframe' : 'image'; - let url = syncUrl + `/${type}?pbjs=1`; - - if (gdprConsent && gdprConsent.consentString) { - if (typeof gdprConsent.gdprApplies === 'boolean') { - url += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`; - } else { - url += `&gdpr=0&gdpr_consent=${gdprConsent.consentString}`; - } - } - - if (uspConsent) { - url += `&ccpa_consent=${uspConsent}`; - } - - if (gppConsent?.gppString && gppConsent?.applicableSections?.length) { - url += '&gpp=' + gppConsent.gppString; - url += '&gpp_sid=' + gppConsent.applicableSections.join(','); - } - - const coppa = config.getConfig('coppa') ? 1 : 0; - url += `&coppa=${coppa}`; - - return [{ - type, - url - }]; -}; - -/** - * - * @param {{ addPlacementType?: function, addCustomFieldsToPlacement?: function }} [config] - * @returns {function(object, object): object} - */ -export const buildPlacementProcessingFunction = (config) => (bid, bidderRequest) => { - const addPlacementType = config?.addPlacementType ?? defaultPlacementType; - - const placement = createBasePlacement(bid, bidderRequest); - - addPlacementType(bid, bidderRequest, placement); - - if (config?.addCustomFieldsToPlacement) { - config.addCustomFieldsToPlacement(bid, bidderRequest, placement); - } - - return placement; -}; diff --git a/libraries/teqblazeUtils/bidderUtils.ts b/libraries/teqblazeUtils/bidderUtils.ts new file mode 100644 index 00000000000..c5832b67b1c --- /dev/null +++ b/libraries/teqblazeUtils/bidderUtils.ts @@ -0,0 +1,372 @@ +import type { CreativeAttribute } from 'iab-adcom'; +import type { Device } from 'iab-openrtb/v25'; + +import { BANNER, NATIVE, VIDEO } from '../../src/mediaTypes.js'; +import { config } from '../../src/config.js'; +import type { + BaseBidderRequest, + BidRequest +} from '../../src/adapterManager.ts'; +import type { + AdapterRequest, + AdapterResponse, + ServerResponse +} from '../../src/adapters/bidderFactory.ts'; +import { + CONSENT_GDPR, + CONSENT_GPP, + CONSENT_USP, + type ConsentData +} from '../../src/consentHandler.ts'; +import type { SyncType } from '../../src/userSync.ts'; +import type { BidderCode, Size } from '../../src/types/common.d.ts'; +import type { DeepPartial } from '../../src/types/objects.d.ts'; + +const PROTOCOL_PATTERN = /^[a-z0-9.+-]+:/i; + +// ── TeqBlaze-specific types ─────────────────────────────────────────────────── + +type Mode = 'every' | 'some'; + +interface TeqBlazeBidParams { + placementId?: string | number; + endpointId?: string | number; +} + +interface RequestBody { + deviceWidth: number; + deviceHeight: number; + language: string; + secure: 0 | 1; + host: string; + page: string; + placements: Placement[]; + coppa: 0 | 1; + tmax: number; + bcat?: string[]; + badv?: string[]; + bapp?: string[]; + ccpa?: string; + gdpr?: { consentString: string }; + gpp?: string; + gpp_sid?: number[]; + device?: DeepPartial; +} + +interface Placement { + bidId: string; + schain: unknown; + bidfloor: number | undefined; + adFormat?: string; + sizes?: Size | Size[]; + playerSize?: Size | Size[]; + minduration?: number; + maxduration?: number; + mimes?: string[]; + protocols?: number[]; + startdelay?: number; + placement?: number; + plcmt?: number; + skip?: number | boolean; + skipafter?: number; + minbitrate?: number; + maxbitrate?: number; + delivery?: number[]; + playbackmethod?: number[]; + api?: number[]; + linearity?: number; + native?: unknown; + ext?: { tid?: string }; + eids?: unknown[]; + gpid?: string; + battr?: CreativeAttribute[]; + placementId?: string | number; + endpointId?: string | number; + type?: 'publisher' | 'network'; +} + +interface PlacementProcessingConfig { + addPlacementType?: (bid: BidRequest, bidderRequest: BaseBidderRequest, placement: Placement) => void; + addCustomFieldsToPlacement?: (bid: BidRequest, bidderRequest: BaseBidderRequest, placement: Placement) => void; +} + +interface BuildRequestsBaseConfig { + adUrl: string; + validBidRequests: BidRequest[]; + bidderRequest: BaseBidderRequest; + placementProcessingFunction?: (bid: BidRequest, bidderRequest: BaseBidderRequest) => Placement; +} + +// ── Implementation ──────────────────────────────────────────────────────────── + +const isBidResponseValid = (bid: any): boolean => { + if (!bid.requestId || !bid.cpm || !bid.creativeId || !bid.ttl || !bid.currency) { + return false; + } + + switch (bid.mediaType) { + case BANNER: + return Boolean(bid.width && bid.height && bid.ad); + case VIDEO: + return Boolean(bid.vastUrl || bid.vastXml); + case NATIVE: + return Boolean(bid.native && bid.native.impressionTrackers && bid.native.impressionTrackers.length); + default: + return false; + } +}; + +const getBidFloor = (bid: BidRequest): number => { + try { + const bidFloor = bid.getFloor({ + currency: 'USD', + mediaType: '*', + size: '*', + }); + + return bidFloor?.floor; + } catch (err) { + return 0; + } +}; + +const createBasePlacement = (bid: BidRequest, bidderRequest: BaseBidderRequest): Placement => { + const { bidId, mediaTypes, transactionId, userIdAsEids, ortb2Imp } = bid; + const schain = bidderRequest?.ortb2?.source?.ext?.schain || {}; + const bidfloor = getBidFloor(bid); + + const placement: Placement = { + bidId, + schain, + bidfloor + }; + + if (mediaTypes && mediaTypes[BANNER]) { + placement.adFormat = BANNER; + placement.sizes = mediaTypes[BANNER].sizes; + placement.battr = mediaTypes[BANNER].battr; + } else if (mediaTypes && mediaTypes[VIDEO]) { + placement.adFormat = VIDEO; + placement.playerSize = mediaTypes[VIDEO].playerSize; + placement.minduration = mediaTypes[VIDEO].minduration; + placement.maxduration = mediaTypes[VIDEO].maxduration; + placement.mimes = mediaTypes[VIDEO].mimes; + placement.protocols = mediaTypes[VIDEO].protocols; + placement.startdelay = mediaTypes[VIDEO].startdelay; + placement.placement = mediaTypes[VIDEO].placement; + placement.plcmt = mediaTypes[VIDEO].plcmt; + placement.skip = mediaTypes[VIDEO].skip; + placement.skipafter = mediaTypes[VIDEO].skipafter; + placement.minbitrate = mediaTypes[VIDEO].minbitrate; + placement.maxbitrate = mediaTypes[VIDEO].maxbitrate; + placement.delivery = mediaTypes[VIDEO].delivery; + placement.playbackmethod = mediaTypes[VIDEO].playbackmethod; + placement.api = mediaTypes[VIDEO].api; + placement.linearity = mediaTypes[VIDEO].linearity; + placement.battr = mediaTypes[VIDEO].battr; + } else if (mediaTypes && mediaTypes[NATIVE]) { + placement.native = mediaTypes[NATIVE]; + placement.adFormat = NATIVE; + } + + if (transactionId) { + placement.ext = placement.ext || {}; + placement.ext.tid = transactionId; + } + + if (userIdAsEids && userIdAsEids.length) { + placement.eids = userIdAsEids; + } + + if (ortb2Imp?.ext?.gpid) { + placement.gpid = ortb2Imp.ext.gpid as string; + } + + return placement; +}; + +const defaultPlacementType = (bid: BidRequest, _bidderRequest: BaseBidderRequest, placement: Placement): void => { + const { placementId, endpointId } = bid.params as TeqBlazeBidParams; + + if (placementId) { + placement.placementId = placementId; + placement.type = 'publisher'; + } else if (endpointId) { + placement.endpointId = endpointId; + placement.type = 'network'; + } +}; + +const checkIfObjectHasKey = (keys: string[], obj: Record, mode: Mode = 'some'): boolean => { + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const val = obj[key]; + + if (mode === 'some' && val) return true; + if (mode === 'every' && !val) return false; + } + + return mode === 'every'; +} + +export const isBidRequestValid = + (keys: string[] = ['placementId', 'endpointId'], mode?: Mode) => + (bid: BidRequest): boolean => { + const { params, bidId, mediaTypes } = bid; + let valid = Boolean(bidId && params && checkIfObjectHasKey(keys, params, mode)); + + if (mediaTypes && mediaTypes[BANNER]) { + valid = valid && Boolean(mediaTypes[BANNER] && mediaTypes[BANNER].sizes); + } else if (mediaTypes && mediaTypes[VIDEO]) { + valid = valid && Boolean(mediaTypes[VIDEO] && mediaTypes[VIDEO].playerSize); + } else if (mediaTypes && mediaTypes[NATIVE]) { + valid = valid && Boolean(mediaTypes[NATIVE]); + } else { + valid = false; + } + + return valid; + }; + +export const buildRequestsBase = (config: BuildRequestsBaseConfig): AdapterRequest => { + const { adUrl, validBidRequests, bidderRequest } = config; + const placementProcessingFunction = config.placementProcessingFunction || buildPlacementProcessingFunction(); + const device = bidderRequest?.ortb2?.device; + const page = bidderRequest?.refererInfo?.page || ''; + + const proto = PROTOCOL_PATTERN.exec(page); + const protocol = proto?.[0]; + + const placements: Placement[] = []; + const request: RequestBody = { + deviceWidth: device?.w || 0, + deviceHeight: device?.h || 0, + language: device?.language?.split('-')[0] || '', + secure: protocol === 'https:' ? 1 : 0, + host: bidderRequest?.refererInfo?.domain || '', + page, + placements, + coppa: bidderRequest?.ortb2?.regs?.coppa ? 1 : 0, + tmax: bidderRequest.timeout, + bcat: bidderRequest?.ortb2?.bcat, + badv: bidderRequest?.ortb2?.badv, + bapp: bidderRequest?.ortb2?.bapp + }; + + if (bidderRequest.uspConsent) { + request.ccpa = bidderRequest.uspConsent; + } + + if (bidderRequest.gdprConsent) { + request.gdpr = { + consentString: bidderRequest.gdprConsent.consentString + }; + } + + if (bidderRequest.gppConsent) { + request.gpp = bidderRequest.gppConsent.gppString; + request.gpp_sid = bidderRequest.gppConsent.applicableSections; + } else if (bidderRequest.ortb2?.regs?.gpp) { + request.gpp = bidderRequest.ortb2.regs.gpp; + request.gpp_sid = bidderRequest.ortb2.regs.gpp_sid; + } + + if (bidderRequest?.ortb2?.device) { + request.device = bidderRequest.ortb2.device; + } + + const len = validBidRequests.length; + for (let i = 0; i < len; i++) { + const bid = validBidRequests[i]; + placements.push(placementProcessingFunction(bid, bidderRequest)); + } + + return { + method: 'POST', + url: adUrl, + data: request + }; +}; + +export const buildRequests = + (adUrl: string) => + (validBidRequests: BidRequest[] = [], bidderRequest: BaseBidderRequest): AdapterRequest => { + const placementProcessingFunction = buildPlacementProcessingFunction(); + + return buildRequestsBase({ adUrl, validBidRequests, bidderRequest, placementProcessingFunction }); + }; + +export function interpretResponseBuilder({ addtlBidValidation = (_bid: any): boolean => true } = {}) { + return function (serverResponse: ServerResponse): AdapterResponse { + const response = []; + for (let i = 0; i < serverResponse.body.length; i++) { + const resItem = serverResponse.body[i]; + if (isBidResponseValid(resItem) && addtlBidValidation(resItem)) { + const advertiserDomains = resItem.adomain && resItem.adomain.length ? resItem.adomain : []; + resItem.meta = { ...resItem.meta, advertiserDomains }; + + response.push(resItem); + } + } + + return response; + } +} + +export const interpretResponse = interpretResponseBuilder(); + +export const getUserSyncs = (syncUrl: string) => ( + syncOptions: { iframeEnabled: boolean; pixelEnabled: boolean }, + _serverResponses: ServerResponse[], + gdprConsent: null | ConsentData[typeof CONSENT_GDPR], + uspConsent: null | ConsentData[typeof CONSENT_USP], + gppConsent: null | ConsentData[typeof CONSENT_GPP] +): { type: SyncType; url: string }[] => { + if (!syncOptions.iframeEnabled && !syncOptions.pixelEnabled) { + return []; + } + + const type: SyncType = syncOptions.iframeEnabled ? 'iframe' : 'image'; + let url = syncUrl + `/${type}?pbjs=1`; + + if (gdprConsent && gdprConsent.consentString) { + if (typeof gdprConsent.gdprApplies === 'boolean') { + url += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`; + } else { + url += `&gdpr=0&gdpr_consent=${gdprConsent.consentString}`; + } + } + + if (uspConsent) { + url += `&ccpa_consent=${uspConsent}`; + } + + if (gppConsent?.gppString && gppConsent?.applicableSections?.length) { + url += '&gpp=' + gppConsent.gppString; + url += '&gpp_sid=' + gppConsent.applicableSections.join(','); + } + + const coppa = config.getConfig('coppa') ? 1 : 0; + url += `&coppa=${coppa}`; + + return [{ + type, + url + }]; +}; + +export const buildPlacementProcessingFunction = + (config?: PlacementProcessingConfig) => + (bid: BidRequest, bidderRequest: BaseBidderRequest): Placement => { + const addPlacementType = config?.addPlacementType ?? defaultPlacementType; + + const placement = createBasePlacement(bid, bidderRequest); + + addPlacementType(bid, bidderRequest, placement); + + if (config?.addCustomFieldsToPlacement) { + config.addCustomFieldsToPlacement(bid, bidderRequest, placement); + } + + return placement; + }; diff --git a/test/spec/libraries/teqblazeUtils/bidderUtils_spec.js b/test/spec/libraries/teqblazeUtils/bidderUtils_spec.js index 73055521549..af081fe8269 100644 --- a/test/spec/libraries/teqblazeUtils/bidderUtils_spec.js +++ b/test/spec/libraries/teqblazeUtils/bidderUtils_spec.js @@ -25,7 +25,8 @@ describe('TeqBlazeBidderUtils', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -45,7 +46,8 @@ describe('TeqBlazeBidderUtils', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -159,8 +161,7 @@ describe('TeqBlazeBidderUtils', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -187,18 +188,17 @@ describe('TeqBlazeBidderUtils', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - expect(placement.gpid).to.be.an('string'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.gpid).to.be.an('string'); + expect(placement.battr).to.exist.and.to.be.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.exist.and.to.be.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -512,11 +512,19 @@ describe('TeqBlazeBidderUtils', function () { }); describe('getUserSyncs', function () { - it('Should return array of objects with proper sync config , include GDPR', function () { + it('Should return an empty array if no sync enabled', function () { const syncData = spec.getUserSyncs({}, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); + expect(syncData).to.be.an('array'); + expect(syncData).to.be.an.deep.equal([]); + }); + it('Should return array of objects with proper sync config , include GDPR', function () { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { + consentString: 'ALL', + gdprApplies: true, + }, undefined); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -525,7 +533,7 @@ describe('TeqBlazeBidderUtils', function () { expect(syncData[0].url).to.equal(`https://${DOMAIN}/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0`) }); it('Should return array of objects with proper sync config , include CCPA', function () { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -534,7 +542,7 @@ describe('TeqBlazeBidderUtils', function () { expect(syncData[0].url).to.equal(`https://${DOMAIN}/image?pbjs=1&ccpa_consent=1---&coppa=0`) }); it('Should return array of objects with proper sync config , include GPP', function () { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/360playvidBidAdapter_spec.js b/test/spec/modules/360playvidBidAdapter_spec.js index 7718c0c2eca..005c53ec750 100644 --- a/test/spec/modules/360playvidBidAdapter_spec.js +++ b/test/spec/modules/360playvidBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('360PlayVidBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('360PlayVidBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('360PlayVidBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -176,17 +177,16 @@ describe('360PlayVidBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -225,9 +225,6 @@ describe('360PlayVidBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -480,7 +477,7 @@ describe('360PlayVidBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -492,7 +489,7 @@ describe('360PlayVidBidAdapter', function () { expect(syncData[0].url).to.equal('https://cookie.360playvid.com/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -501,7 +498,7 @@ describe('360PlayVidBidAdapter', function () { expect(syncData[0].url).to.equal('https://cookie.360playvid.com/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/acuityadsBidAdapter_spec.js b/test/spec/modules/acuityadsBidAdapter_spec.js index f7979c969df..f1eada7d5ac 100644 --- a/test/spec/modules/acuityadsBidAdapter_spec.js +++ b/test/spec/modules/acuityadsBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('AcuityAdsBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('AcuityAdsBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('AcuityAdsBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -177,66 +178,16 @@ describe('AcuityAdsBidAdapter', function () { expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); expect(placement.publisherId).to.exist.and.to.be.a('string'); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } - switch (placement.adFormat) { - case BANNER: - expect(placement.sizes).to.be.an('array'); - break; - case VIDEO: - expect(placement.playerSize).to.be.an('array'); - expect(placement.minduration).to.be.an('number'); - expect(placement.maxduration).to.be.an('number'); - break; - case NATIVE: - expect(placement.native).to.be.an('object'); - break; - } - } - }); - - it('Returns valid endpoints', function () { - const bids = [ - { - bidId: getUniqueIdentifierStr(), - bidder: bidder, - mediaTypes: { - [BANNER]: { - sizes: [[300, 250]] - } - }, - params: { - endpointId: 'testBanner', - }, - userIdAsEids - } - ]; - - let serverRequest = spec.buildRequests(bids, bidderRequest); - - const { placements } = serverRequest.data; - for (let i = 0, len = placements.length; i < len; i++) { - const placement = placements[i]; - expect(placement.endpointId).to.be.oneOf(['testBanner', 'testVideo', 'testNative']); - expect(placement.adFormat).to.be.oneOf([BANNER, VIDEO, NATIVE]); - expect(placement.bidId).to.be.a('string'); - expect(placement.schain).to.be.an('object'); - expect(placement.bidfloor).to.exist.and.to.equal(0); - expect(placement.type).to.exist.and.to.equal('network'); - expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -275,9 +226,6 @@ describe('AcuityAdsBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -528,7 +476,7 @@ describe('AcuityAdsBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -540,7 +488,7 @@ describe('AcuityAdsBidAdapter', function () { expect(syncData[0].url).to.equal('https://cs.admanmedia.com/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -549,7 +497,7 @@ describe('AcuityAdsBidAdapter', function () { expect(syncData[0].url).to.equal('https://cs.admanmedia.com/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/adprimeBidAdapter_spec.js b/test/spec/modules/adprimeBidAdapter_spec.js index d49281d79c6..b9e65603cf5 100644 --- a/test/spec/modules/adprimeBidAdapter_spec.js +++ b/test/spec/modules/adprimeBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('AdprimeBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('AdprimeBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('AdprimeBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -177,12 +178,10 @@ describe('AdprimeBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.wPlayer).to.be.an('number'); @@ -191,6 +190,7 @@ describe('AdprimeBidAdapter', function () { expect(placement.audiences).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -433,7 +433,7 @@ describe('AdprimeBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -445,7 +445,7 @@ describe('AdprimeBidAdapter', function () { expect(syncData[0].url).to.equal('https://sync.adprime.com/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -454,7 +454,7 @@ describe('AdprimeBidAdapter', function () { expect(syncData[0].url).to.equal('https://sync.adprime.com/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/ads_interactiveBidAdapter_spec.js b/test/spec/modules/ads_interactiveBidAdapter_spec.js index c3d27008182..5e54934194b 100644 --- a/test/spec/modules/ads_interactiveBidAdapter_spec.js +++ b/test/spec/modules/ads_interactiveBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('AdsInteractiveBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('AdsInteractiveBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -149,8 +151,7 @@ describe('AdsInteractiveBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -177,17 +178,16 @@ describe('AdsInteractiveBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -226,9 +226,6 @@ describe('AdsInteractiveBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -479,7 +476,7 @@ describe('AdsInteractiveBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -491,7 +488,7 @@ describe('AdsInteractiveBidAdapter', function () { expect(syncData[0].url).to.equal('https://cstb.adsinteractive.com/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -500,7 +497,7 @@ describe('AdsInteractiveBidAdapter', function () { expect(syncData[0].url).to.equal('https://cstb.adsinteractive.com/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/appStockSSPBidAdapter_spec.js b/test/spec/modules/appStockSSPBidAdapter_spec.js index 64dac5fe8e7..dbb0c892ba6 100644 --- a/test/spec/modules/appStockSSPBidAdapter_spec.js +++ b/test/spec/modules/appStockSSPBidAdapter_spec.js @@ -2,8 +2,6 @@ import { expect } from 'chai'; import { spec } from '../../../modules/appStockSSPBidAdapter.js'; import { BANNER, VIDEO, NATIVE } from '../../../src/mediaTypes.js'; import { getUniqueIdentifierStr } from '../../../src/utils.js'; -import { config } from '../../../src/config.js'; -import { USERSYNC_DEFAULT_CONFIG } from '../../../src/userSync.js'; const bidder = 'appStockSSP'; @@ -24,7 +22,8 @@ describe('AppStockSSPBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -40,7 +39,8 @@ describe('AppStockSSPBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -166,8 +166,7 @@ describe('AppStockSSPBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -194,17 +193,16 @@ describe('AppStockSSPBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -243,9 +241,6 @@ describe('AppStockSSPBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -496,7 +491,7 @@ describe('AppStockSSPBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -508,7 +503,7 @@ describe('AppStockSSPBidAdapter', function () { expect(syncData[0].url).to.equal('https://csync.al-ad.com/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -517,7 +512,7 @@ describe('AppStockSSPBidAdapter', function () { expect(syncData[0].url).to.equal('https://csync.al-ad.com/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/appushBidAdapter_spec.js b/test/spec/modules/appushBidAdapter_spec.js index b6c535c463e..316be273b36 100644 --- a/test/spec/modules/appushBidAdapter_spec.js +++ b/test/spec/modules/appushBidAdapter_spec.js @@ -12,7 +12,8 @@ describe('AppushBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -26,7 +27,8 @@ describe('AppushBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -127,8 +129,7 @@ describe('AppushBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -154,17 +155,16 @@ describe('AppushBidAdapter', function () { expect(placement.bidfloor).to.exist.and.to.equal(0); expect(placement.type).to.exist.and.to.equal('publisher'); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); diff --git a/test/spec/modules/axisBidAdapter_spec.js b/test/spec/modules/axisBidAdapter_spec.js index 069e1834011..ba847778962 100644 --- a/test/spec/modules/axisBidAdapter_spec.js +++ b/test/spec/modules/axisBidAdapter_spec.js @@ -23,7 +23,8 @@ describe('AxisBidAdapter', function () { mediaTypes: { [BANNER]: { sizes: [[300, 250]], - pos: 1 + pos: 1, + battr: [1, 3] } }, params: { @@ -40,7 +41,8 @@ describe('AxisBidAdapter', function () { playerSize: [[300, 300]], minduration: 5, maxduration: 60, - pos: 1 + pos: 1, + battr: [1, 3] } }, params: { @@ -157,8 +159,7 @@ describe('AxisBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -186,12 +187,10 @@ describe('AxisBidAdapter', function () { expect(placement.bidfloor).to.exist.and.to.equal(0); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); expect(placement.pos).to.be.within(0, 7); break; case VIDEO: @@ -199,6 +198,7 @@ describe('AxisBidAdapter', function () { expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); expect(placement.pos).to.be.within(0, 7); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -443,7 +443,7 @@ describe('AxisBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, {}); @@ -455,7 +455,7 @@ describe('AxisBidAdapter', function () { expect(syncData[0].url).to.equal('https://cs.axis-marketplace.com/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, { consentString: '1---' }); expect(syncData).to.be.an('array').which.is.not.empty; @@ -466,7 +466,7 @@ describe('AxisBidAdapter', function () { expect(syncData[0].url).to.equal('https://cs.axis-marketplace.com/image?pbjs=1&ccpa=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, {}, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/beyondmediaBidAdapter_spec.js b/test/spec/modules/beyondmediaBidAdapter_spec.js index 5ee8d73207b..5d206692ff8 100644 --- a/test/spec/modules/beyondmediaBidAdapter_spec.js +++ b/test/spec/modules/beyondmediaBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('AndBeyondMediaBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('AndBeyondMediaBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('AndBeyondMediaBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -175,17 +176,16 @@ describe('AndBeyondMediaBidAdapter', function () { expect(placement.bidfloor).to.exist.and.to.equal(0); expect(placement.type).to.exist.and.to.equal('publisher'); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -428,7 +428,7 @@ describe('AndBeyondMediaBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -440,7 +440,7 @@ describe('AndBeyondMediaBidAdapter', function () { expect(syncData[0].url).to.equal('https://cookies.andbeyond.media/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -449,7 +449,7 @@ describe('AndBeyondMediaBidAdapter', function () { expect(syncData[0].url).to.equal('https://cookies.andbeyond.media/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/bidfuseBidAdapter_spec.js b/test/spec/modules/bidfuseBidAdapter_spec.js index 419cf6e6f3e..362ea3f6fc9 100644 --- a/test/spec/modules/bidfuseBidAdapter_spec.js +++ b/test/spec/modules/bidfuseBidAdapter_spec.js @@ -23,7 +23,8 @@ describe('BidfuseBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -38,7 +39,8 @@ describe('BidfuseBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -164,8 +166,7 @@ describe('BidfuseBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -192,17 +193,16 @@ describe('BidfuseBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -241,9 +241,6 @@ describe('BidfuseBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); diff --git a/test/spec/modules/boldwinBidAdapter_spec.js b/test/spec/modules/boldwinBidAdapter_spec.js index fdaa0f19f3f..8bda198a4eb 100644 --- a/test/spec/modules/boldwinBidAdapter_spec.js +++ b/test/spec/modules/boldwinBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('BoldwinBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('BoldwinBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('BoldwinBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -177,18 +178,17 @@ describe('BoldwinBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.wPlayer).to.be.an('number'); expect(placement.hPlayer).to.be.an('number'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -431,7 +431,7 @@ describe('BoldwinBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -443,7 +443,7 @@ describe('BoldwinBidAdapter', function () { expect(syncData[0].url).to.equal('https://sync.videowalldirect.com/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -452,7 +452,7 @@ describe('BoldwinBidAdapter', function () { expect(syncData[0].url).to.equal('https://sync.videowalldirect.com/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index cc926e61b9e..55c1f04340c 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -14,7 +14,8 @@ describe('ColossussspAdapter', function () { auctionId: '74f78609-a92d-4cf1-869f-1b244bbfb5d2', mediaTypes: { banner: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, ortb2Imp: { @@ -193,7 +194,7 @@ describe('ColossussspAdapter', function () { const placements = data['placements']; for (let i = 0; i < placements.length; i++) { const placement = placements[i]; - expect(placement).to.have.all.keys('placementId', 'groupId', 'eids', 'bidId', 'traffic', 'sizes', 'schain', 'floor', 'gpid', 'tid'); + expect(placement).to.have.all.keys('placementId', 'groupId', 'eids', 'bidId', 'traffic', 'sizes', 'schain', 'floor', 'gpid', 'tid', 'battr'); expect(placement.schain).to.be.an('object') expect(placement.placementId).to.be.a('number'); expect(placement.groupId).to.be.a('number'); @@ -203,6 +204,7 @@ describe('ColossussspAdapter', function () { expect(placement.floor).to.be.an('object'); expect(placement.gpid).to.be.an('string'); expect(placement.tid).to.be.an('string'); + expect(placement.battr).to.deep.equal([1, 3]); } }); @@ -216,7 +218,8 @@ describe('ColossussspAdapter', function () { video: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } } } @@ -236,7 +239,7 @@ describe('ColossussspAdapter', function () { const placement = placements[i]; expect(placement).to.have.all.keys('placementId', 'groupId', 'eids', 'bidId', 'traffic', 'schain', 'floor', 'gpid', 'sizes', 'playerSize', 'minduration', 'maxduration', 'mimes', 'protocols', 'startdelay', 'placement', 'skip', 'skipafter', - 'minbitrate', 'maxbitrate', 'delivery', 'playbackmethod', 'api', 'linearity', 'tid' + 'minbitrate', 'maxbitrate', 'delivery', 'playbackmethod', 'api', 'linearity', 'tid', 'battr' ); expect(placement.schain).to.be.an('object') expect(placement.placementId).to.be.a('number'); @@ -447,7 +450,7 @@ describe('ColossussspAdapter', function () { }) describe('getUserSyncs', function () { - const userSync = spec.getUserSyncs({}, {}, { consentString: 'xxx', gdprApplies: 1 }, '1YN-'); + const userSync = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'xxx', gdprApplies: 1 }, '1YN-'); it('Returns valid URL and type', function () { expect(userSync).to.be.an('array').with.lengthOf(1); expect(userSync[0].type).to.exist; diff --git a/test/spec/modules/compassBidAdapter_spec.js b/test/spec/modules/compassBidAdapter_spec.js index 57412de4379..c96e4a3f7ae 100644 --- a/test/spec/modules/compassBidAdapter_spec.js +++ b/test/spec/modules/compassBidAdapter_spec.js @@ -23,7 +23,8 @@ describe('CompassBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -38,7 +39,8 @@ describe('CompassBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -149,8 +151,7 @@ describe('CompassBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -177,17 +178,16 @@ describe('CompassBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -226,9 +226,6 @@ describe('CompassBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -479,7 +476,7 @@ describe('CompassBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = config.runWithBidder(bidder, () => spec.getUserSyncs({}, {}, { + const syncData = config.runWithBidder(bidder, () => spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined)); @@ -491,7 +488,7 @@ describe('CompassBidAdapter', function () { expect(syncData[0].url).to.equal('https://sa-cs.deliverimp.com/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = config.runWithBidder(bidder, () => spec.getUserSyncs({}, {}, {}, '1---')); + const syncData = config.runWithBidder(bidder, () => spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---')); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -500,7 +497,7 @@ describe('CompassBidAdapter', function () { expect(syncData[0].url).to.equal('https://sa-cs.deliverimp.com/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = config.runWithBidder(bidder, () => spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = config.runWithBidder(bidder, () => spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] })); diff --git a/test/spec/modules/contentexchangeBidAdapter_spec.js b/test/spec/modules/contentexchangeBidAdapter_spec.js index cdf5be50250..99b049f17be 100644 --- a/test/spec/modules/contentexchangeBidAdapter_spec.js +++ b/test/spec/modules/contentexchangeBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('ContentexchangeBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('ContentexchangeBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('ContentexchangeBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -176,17 +177,16 @@ describe('ContentexchangeBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -225,9 +225,6 @@ describe('ContentexchangeBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -478,7 +475,7 @@ describe('ContentexchangeBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -490,7 +487,7 @@ describe('ContentexchangeBidAdapter', function () { expect(syncData[0].url).to.equal('https://sync2.adnetwork.agency/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -499,7 +496,7 @@ describe('ContentexchangeBidAdapter', function () { expect(syncData[0].url).to.equal('https://sync2.adnetwork.agency/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/contxtfulBidAdapter_spec.js b/test/spec/modules/contxtfulBidAdapter_spec.js index f0695130b50..8217a9f2eeb 100644 --- a/test/spec/modules/contxtfulBidAdapter_spec.js +++ b/test/spec/modules/contxtfulBidAdapter_spec.js @@ -884,8 +884,7 @@ describe('contxtful bid adapter', function () { const userSyncs = spec.getUserSyncs({}, [{ body: bidResponse }]); expect(userSyncs).to.deep.equal([ { - 'url': 'mysyncurl.com/image?pbjs=1&coppa=0&qparam1=qparamv1&qparam2=qparamv2', - 'type': 'image' + 'url': 'mysyncurl.com?qparam1=qparamv1&qparam2=qparamv2' } ]); }); diff --git a/test/spec/modules/copper6sspBidAdapter_spec.js b/test/spec/modules/copper6sspBidAdapter_spec.js index 888291c5997..2ff392f3de2 100644 --- a/test/spec/modules/copper6sspBidAdapter_spec.js +++ b/test/spec/modules/copper6sspBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('Copper6SSPBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('Copper6SSPBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -149,8 +151,7 @@ describe('Copper6SSPBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -177,17 +178,16 @@ describe('Copper6SSPBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -226,9 +226,6 @@ describe('Copper6SSPBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -481,7 +478,7 @@ describe('Copper6SSPBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -493,7 +490,7 @@ describe('Copper6SSPBidAdapter', function () { expect(syncData[0].url).to.equal('https://сsync.copper6.com/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -502,7 +499,7 @@ describe('Copper6SSPBidAdapter', function () { expect(syncData[0].url).to.equal('https://сsync.copper6.com/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/dpaiBidAdapter_spec.js b/test/spec/modules/dpaiBidAdapter_spec.js index f81c3aa7c95..d4eaf7088a8 100644 --- a/test/spec/modules/dpaiBidAdapter_spec.js +++ b/test/spec/modules/dpaiBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('DpaiBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('DpaiBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -145,8 +147,7 @@ describe('DpaiBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -173,17 +174,16 @@ describe('DpaiBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -222,9 +222,6 @@ describe('DpaiBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -475,7 +472,7 @@ describe('DpaiBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -487,7 +484,7 @@ describe('DpaiBidAdapter', function () { expect(syncData[0].url).to.equal('https://sync.drift-pixel.ai/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -496,7 +493,7 @@ describe('DpaiBidAdapter', function () { expect(syncData[0].url).to.equal('https://sync.drift-pixel.ai/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/e_volutionBidAdapter_spec.js b/test/spec/modules/e_volutionBidAdapter_spec.js index 73a10ca1006..0770d717862 100644 --- a/test/spec/modules/e_volutionBidAdapter_spec.js +++ b/test/spec/modules/e_volutionBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('EvolutionTechBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('EvolutionTechBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('EvolutionTechBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -176,17 +177,16 @@ describe('EvolutionTechBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -225,9 +225,6 @@ describe('EvolutionTechBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); diff --git a/test/spec/modules/edge226BidAdapter_spec.js b/test/spec/modules/edge226BidAdapter_spec.js index c0da49e2327..0727907b790 100644 --- a/test/spec/modules/edge226BidAdapter_spec.js +++ b/test/spec/modules/edge226BidAdapter_spec.js @@ -22,7 +22,8 @@ describe('Edge226BidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('Edge226BidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -149,8 +151,7 @@ describe('Edge226BidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -177,17 +178,16 @@ describe('Edge226BidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -226,9 +226,6 @@ describe('Edge226BidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); diff --git a/test/spec/modules/emtvBidAdapter_spec.js b/test/spec/modules/emtvBidAdapter_spec.js index a75522607c1..221eeb47330 100644 --- a/test/spec/modules/emtvBidAdapter_spec.js +++ b/test/spec/modules/emtvBidAdapter_spec.js @@ -24,7 +24,8 @@ describe('EMTVBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -39,7 +40,8 @@ describe('EMTVBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -150,8 +152,7 @@ describe('EMTVBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -178,17 +179,16 @@ describe('EMTVBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -227,9 +227,6 @@ describe('EMTVBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -482,7 +479,7 @@ describe('EMTVBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -494,7 +491,7 @@ describe('EMTVBidAdapter', function () { expect(syncData[0].url).to.equal(`${syncUrl}/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0`) }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -503,7 +500,7 @@ describe('EMTVBidAdapter', function () { expect(syncData[0].url).to.equal(`${syncUrl}/image?pbjs=1&ccpa_consent=1---&coppa=0`) }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/harionBidAdapter_spec.js b/test/spec/modules/harionBidAdapter_spec.js index d5a1dd509a6..ea11933370e 100644 --- a/test/spec/modules/harionBidAdapter_spec.js +++ b/test/spec/modules/harionBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('HarionBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('HarionBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -145,8 +147,7 @@ describe('HarionBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -173,17 +174,16 @@ describe('HarionBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -222,9 +222,6 @@ describe('HarionBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); diff --git a/test/spec/modules/iqzoneBidAdapter_spec.js b/test/spec/modules/iqzoneBidAdapter_spec.js index 7f48b7077bf..9df70122696 100644 --- a/test/spec/modules/iqzoneBidAdapter_spec.js +++ b/test/spec/modules/iqzoneBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('IQZoneBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('IQZoneBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('IQZoneBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -176,17 +177,16 @@ describe('IQZoneBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -225,9 +225,6 @@ describe('IQZoneBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -477,7 +474,7 @@ describe('IQZoneBidAdapter', function () { }); describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -489,7 +486,7 @@ describe('IQZoneBidAdapter', function () { expect(syncData[0].url).to.equal('https://cs.iqzone.com/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -498,7 +495,7 @@ describe('IQZoneBidAdapter', function () { expect(syncData[0].url).to.equal('https://cs.iqzone.com/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/kiviadsBidAdapter_spec.js b/test/spec/modules/kiviadsBidAdapter_spec.js index d7cbd189782..1c5e8c6df90 100644 --- a/test/spec/modules/kiviadsBidAdapter_spec.js +++ b/test/spec/modules/kiviadsBidAdapter_spec.js @@ -24,7 +24,8 @@ describe('KiviAdsBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -39,7 +40,8 @@ describe('KiviAdsBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -150,8 +152,7 @@ describe('KiviAdsBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -178,17 +179,16 @@ describe('KiviAdsBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -227,9 +227,6 @@ describe('KiviAdsBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -480,7 +477,7 @@ describe('KiviAdsBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -492,7 +489,7 @@ describe('KiviAdsBidAdapter', function () { expect(syncData[0].url).to.equal(`${syncUrl}/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0`) }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -501,7 +498,7 @@ describe('KiviAdsBidAdapter', function () { expect(syncData[0].url).to.equal(`${syncUrl}/image?pbjs=1&ccpa_consent=1---&coppa=0`) }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/krushmediaBidAdapter_spec.js b/test/spec/modules/krushmediaBidAdapter_spec.js index 044d9d4f26b..4aace919e64 100644 --- a/test/spec/modules/krushmediaBidAdapter_spec.js +++ b/test/spec/modules/krushmediaBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('KrushmediabBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('KrushmediabBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('KrushmediabBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -176,18 +177,17 @@ describe('KrushmediabBidAdapter', function () { expect(placement.bidfloor).to.exist.and.to.equal(0); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.traffic === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.traffic) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.wPlayer).to.be.an('number'); expect(placement.hPlayer).to.be.an('number'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -226,9 +226,6 @@ describe('KrushmediabBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.traffic === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.traffic) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -480,7 +477,7 @@ describe('KrushmediabBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -492,7 +489,7 @@ describe('KrushmediabBidAdapter', function () { expect(syncData[0].url).to.equal('https://cs.krushmedia.com/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -501,7 +498,7 @@ describe('KrushmediabBidAdapter', function () { expect(syncData[0].url).to.equal('https://cs.krushmedia.com/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/loyalBidAdapter_spec.js b/test/spec/modules/loyalBidAdapter_spec.js index e9b82c5426c..5fb6dbaef1a 100644 --- a/test/spec/modules/loyalBidAdapter_spec.js +++ b/test/spec/modules/loyalBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('LoyalBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('LoyalBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('LoyalBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -176,17 +177,16 @@ describe('LoyalBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -225,9 +225,6 @@ describe('LoyalBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); diff --git a/test/spec/modules/lunamediahbBidAdapter_spec.js b/test/spec/modules/lunamediahbBidAdapter_spec.js index 25a59ba32fe..eaed03b9061 100644 --- a/test/spec/modules/lunamediahbBidAdapter_spec.js +++ b/test/spec/modules/lunamediahbBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('LunamediaHBBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('LunamediaHBBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('LunamediaHBBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -176,17 +177,16 @@ describe('LunamediaHBBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -429,7 +429,7 @@ describe('LunamediaHBBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -441,7 +441,7 @@ describe('LunamediaHBBidAdapter', function () { expect(syncData[0].url).to.equal('https://cookie.lmgssp.com/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -450,7 +450,7 @@ describe('LunamediaHBBidAdapter', function () { expect(syncData[0].url).to.equal('https://cookie.lmgssp.com/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/mathildeadsBidAdapter_spec.js b/test/spec/modules/mathildeadsBidAdapter_spec.js index 21b7b4a7d21..40628d00a81 100644 --- a/test/spec/modules/mathildeadsBidAdapter_spec.js +++ b/test/spec/modules/mathildeadsBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('MathildeAdsBidAdapter', function () { bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('MathildeAdsBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('MathildeAdsBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -176,17 +177,16 @@ describe('MathildeAdsBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -429,7 +429,7 @@ describe('MathildeAdsBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -441,7 +441,7 @@ describe('MathildeAdsBidAdapter', function () { expect(syncData[0].url).to.equal('https://cs2.mathilde-ads.com/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -450,7 +450,7 @@ describe('MathildeAdsBidAdapter', function () { expect(syncData[0].url).to.equal('https://cs2.mathilde-ads.com/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/mgidXBidAdapter_spec.js b/test/spec/modules/mgidXBidAdapter_spec.js index 86d448e5be8..5e257d8183a 100644 --- a/test/spec/modules/mgidXBidAdapter_spec.js +++ b/test/spec/modules/mgidXBidAdapter_spec.js @@ -24,7 +24,8 @@ describe('MGIDXBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -40,7 +41,8 @@ describe('MGIDXBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -160,8 +162,7 @@ describe('MGIDXBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -188,17 +189,16 @@ describe('MGIDXBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -237,9 +237,6 @@ describe('MGIDXBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); diff --git a/test/spec/modules/mobfoxpbBidAdapter_spec.js b/test/spec/modules/mobfoxpbBidAdapter_spec.js index a5bd3697db4..e632ed34f75 100644 --- a/test/spec/modules/mobfoxpbBidAdapter_spec.js +++ b/test/spec/modules/mobfoxpbBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('MobfoxHBBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('MobfoxHBBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('MobfoxHBBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -177,17 +178,16 @@ describe('MobfoxHBBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -226,9 +226,6 @@ describe('MobfoxHBBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.traffic) { case BANNER: expect(placement.sizes).to.be.an('array'); diff --git a/test/spec/modules/mycodemediaBidAdapter_spec.js b/test/spec/modules/mycodemediaBidAdapter_spec.js index fbf40f4b403..974db27f328 100644 --- a/test/spec/modules/mycodemediaBidAdapter_spec.js +++ b/test/spec/modules/mycodemediaBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('MyCodeMediaBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('MyCodeMediaBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -145,8 +147,7 @@ describe('MyCodeMediaBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -173,17 +174,16 @@ describe('MyCodeMediaBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -222,9 +222,6 @@ describe('MyCodeMediaBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -475,7 +472,7 @@ describe('MyCodeMediaBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -487,7 +484,7 @@ describe('MyCodeMediaBidAdapter', function () { expect(syncData[0].url).to.equal('https://usersync.mycodemedia.com/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -496,7 +493,7 @@ describe('MyCodeMediaBidAdapter', function () { expect(syncData[0].url).to.equal('https://usersync.mycodemedia.com/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/nubaBidAdapter_spec.js b/test/spec/modules/nubaBidAdapter_spec.js index ad08015455e..f02714f25af 100644 --- a/test/spec/modules/nubaBidAdapter_spec.js +++ b/test/spec/modules/nubaBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('NubaBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('NubaBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -145,8 +147,7 @@ describe('NubaBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -173,17 +174,16 @@ describe('NubaBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -222,9 +222,6 @@ describe('NubaBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); diff --git a/test/spec/modules/orakiBidAdapter_spec.js b/test/spec/modules/orakiBidAdapter_spec.js index f3f31be3e30..6fbccbdc312 100644 --- a/test/spec/modules/orakiBidAdapter_spec.js +++ b/test/spec/modules/orakiBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('OrakiBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('OrakiBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -145,8 +147,7 @@ describe('OrakiBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -173,17 +174,16 @@ describe('OrakiBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -222,9 +222,6 @@ describe('OrakiBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -475,7 +472,7 @@ describe('OrakiBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -487,7 +484,7 @@ describe('OrakiBidAdapter', function () { expect(syncData[0].url).to.equal('https://sync.oraki.io/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -496,7 +493,7 @@ describe('OrakiBidAdapter', function () { expect(syncData[0].url).to.equal('https://sync.oraki.io/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/pgamsspBidAdapter_spec.js b/test/spec/modules/pgamsspBidAdapter_spec.js index b881be50402..130d386c7ec 100644 --- a/test/spec/modules/pgamsspBidAdapter_spec.js +++ b/test/spec/modules/pgamsspBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('PGAMBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('PGAMBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('PGAMBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -176,17 +177,16 @@ describe('PGAMBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -225,9 +225,6 @@ describe('PGAMBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -478,7 +475,7 @@ describe('PGAMBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -490,7 +487,7 @@ describe('PGAMBidAdapter', function () { expect(syncData[0].url).to.equal('https://cs.pgammedia.com/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -499,7 +496,7 @@ describe('PGAMBidAdapter', function () { expect(syncData[0].url).to.equal('https://cs.pgammedia.com/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/pinkLionBidAdapter_spec.js b/test/spec/modules/pinkLionBidAdapter_spec.js index 1420eef14a8..235c09ccfe8 100644 --- a/test/spec/modules/pinkLionBidAdapter_spec.js +++ b/test/spec/modules/pinkLionBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('PinkLionBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('PinkLionBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('PinkLionBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -176,17 +177,16 @@ describe('PinkLionBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -225,9 +225,6 @@ describe('PinkLionBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); diff --git a/test/spec/modules/playdigoBidAdapter_spec.js b/test/spec/modules/playdigoBidAdapter_spec.js index d3a2fc204af..4369ec086b3 100644 --- a/test/spec/modules/playdigoBidAdapter_spec.js +++ b/test/spec/modules/playdigoBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('PlaydigoBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('PlaydigoBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('PlaydigoBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -176,17 +177,16 @@ describe('PlaydigoBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -225,9 +225,6 @@ describe('PlaydigoBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); diff --git a/test/spec/modules/pubCircleBidAdapter_spec.js b/test/spec/modules/pubCircleBidAdapter_spec.js index ebf53063c52..228db7b8f1d 100644 --- a/test/spec/modules/pubCircleBidAdapter_spec.js +++ b/test/spec/modules/pubCircleBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('PubCircleBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('PubCircleBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('PubCircleBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -176,17 +177,16 @@ describe('PubCircleBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -429,7 +429,7 @@ describe('PubCircleBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -441,7 +441,7 @@ describe('PubCircleBidAdapter', function () { expect(syncData[0].url).to.equal('https://cs.pubcircle.ai/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -450,7 +450,7 @@ describe('PubCircleBidAdapter', function () { expect(syncData[0].url).to.equal('https://cs.pubcircle.ai/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/pubriseBidAdapter_spec.js b/test/spec/modules/pubriseBidAdapter_spec.js index 37aaa964602..cfd2a38193e 100644 --- a/test/spec/modules/pubriseBidAdapter_spec.js +++ b/test/spec/modules/pubriseBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('PubriseBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('PubriseBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -149,8 +151,7 @@ describe('PubriseBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -177,17 +178,16 @@ describe('PubriseBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -226,9 +226,6 @@ describe('PubriseBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -479,7 +476,7 @@ describe('PubriseBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -491,7 +488,7 @@ describe('PubriseBidAdapter', function () { expect(syncData[0].url).to.equal('https://sync.pubrise.ai/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -500,7 +497,7 @@ describe('PubriseBidAdapter', function () { expect(syncData[0].url).to.equal('https://sync.pubrise.ai/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/qtBidAdapter_spec.js b/test/spec/modules/qtBidAdapter_spec.js index b2b7511cb18..33453d35bff 100644 --- a/test/spec/modules/qtBidAdapter_spec.js +++ b/test/spec/modules/qtBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('QTBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('QTBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('QTBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -176,17 +177,16 @@ describe('QTBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -225,9 +225,6 @@ describe('QTBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -478,7 +475,7 @@ describe('QTBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -490,7 +487,7 @@ describe('QTBidAdapter', function () { expect(syncData[0].url).to.equal('https://cs.qt.io/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0') }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -499,7 +496,7 @@ describe('QTBidAdapter', function () { expect(syncData[0].url).to.equal('https://cs.qt.io/image?pbjs=1&ccpa_consent=1---&coppa=0') }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); diff --git a/test/spec/modules/rocketlabBidAdapter_spec.js b/test/spec/modules/rocketlabBidAdapter_spec.js index ffe48e4c2d9..7005ba0bdaa 100644 --- a/test/spec/modules/rocketlabBidAdapter_spec.js +++ b/test/spec/modules/rocketlabBidAdapter_spec.js @@ -27,6 +27,7 @@ describe("RocketLabBidAdapter", function () { mediaTypes: { [BANNER]: { sizes: [[300, 250]], + battr: [1, 3], }, }, params: { @@ -42,6 +43,7 @@ describe("RocketLabBidAdapter", function () { playerSize: [[300, 300]], minduration: 5, maxduration: 60, + battr: [1, 3], }, }, params: { @@ -139,8 +141,7 @@ describe("RocketLabBidAdapter", function () { "tmax", "bcat", "badv", - "bapp", - "battr" + "bapp" ); expect(data.deviceWidth).to.be.a("number"); expect(data.deviceHeight).to.be.a("number"); @@ -171,17 +172,16 @@ describe("RocketLabBidAdapter", function () { expect(placement.type).to.exist.and.to.equal("publisher"); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an("array"); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an("array"); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an("array"); expect(placement.minduration).to.be.an("number"); expect(placement.maxduration).to.be.an("number"); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an("object"); @@ -224,9 +224,6 @@ describe("RocketLabBidAdapter", function () { expect(placement.type).to.exist.and.to.equal("network"); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an("array"); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an("array"); @@ -538,7 +535,7 @@ describe("RocketLabBidAdapter", function () { describe("getUserSyncs", function () { it("Should return array of objects with proper sync config , include GDPR", function () { const syncData = spec.getUserSyncs( - {}, + { pixelEnabled: true }, {}, { consentString: "ALL", @@ -557,7 +554,7 @@ describe("RocketLabBidAdapter", function () { }); it("Should return array of objects with proper sync config , include CCPA", function () { const syncData = spec.getUserSyncs( - {}, + { pixelEnabled: true }, {}, {}, "1---" @@ -573,7 +570,7 @@ describe("RocketLabBidAdapter", function () { }); it("Should return array of objects with proper sync config , include GPP", function () { const syncData = spec.getUserSyncs( - {}, + { pixelEnabled: true }, {}, {}, undefined, diff --git a/test/spec/modules/screencoreBidAdapter_spec.js b/test/spec/modules/screencoreBidAdapter_spec.js index c80998a4672..1bff51a8384 100644 --- a/test/spec/modules/screencoreBidAdapter_spec.js +++ b/test/spec/modules/screencoreBidAdapter_spec.js @@ -15,7 +15,8 @@ const BID = { }, mediaTypes: { banner: { - sizes: [[300, 250], [300, 600]] + sizes: [[300, 250], [300, 600]], + battr: [1, 3] } }, ortb2Imp: { @@ -46,7 +47,8 @@ const VIDEO_BID = { startdelay: 0, linearity: 1, api: [2], - placement: 1 + placement: 1, + battr: [1, 3] } }, ortb2Imp: { @@ -232,6 +234,7 @@ describe('screencore bid adapter', function () { expect(requests.data.placements).to.be.an('array'); expect(requests.data.placements[0].bidId).to.equal(BID.bidId); expect(requests.data.placements[0].adFormat).to.equal(BANNER); + expect(requests.data.placements[0].battr).to.deep.equal([1, 3]); }); it('should build video request', function () { @@ -241,6 +244,7 @@ describe('screencore bid adapter', function () { expect(requests.data.placements).to.be.an('array'); expect(requests.data.placements[0].bidId).to.equal(VIDEO_BID.bidId); expect(requests.data.placements[0].adFormat).to.equal(VIDEO); + expect(requests.data.placements[0].battr).to.deep.equal([1, 3]); }); it('should build native request', function () { diff --git a/test/spec/modules/smarthubBidAdapter_spec.js b/test/spec/modules/smarthubBidAdapter_spec.js index b2bf9a3bdd2..35afd5adecf 100644 --- a/test/spec/modules/smarthubBidAdapter_spec.js +++ b/test/spec/modules/smarthubBidAdapter_spec.js @@ -13,7 +13,8 @@ describe('SmartHubBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -67,6 +68,7 @@ describe('SmartHubBidAdapter', function () { minduration: 5, maxduration: 60, plcmt: 1, + battr: [1, 3], } }, params: { @@ -183,8 +185,7 @@ describe('SmartHubBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -214,18 +215,17 @@ describe('SmartHubBidAdapter', function () { expect(placement.schain).to.be.an('object'); expect(placement.bidfloor).to.exist.and.to.equal(0); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); expect(placement.plcmt).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -443,7 +443,7 @@ describe('SmartHubBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with GDPR values', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -455,7 +455,7 @@ describe('SmartHubBidAdapter', function () { expect(syncData[0].url).to.equal('https://us4.shb-sync.com/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0&pid=360') }); it('Should return array of objects with CCPA values', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -464,7 +464,7 @@ describe('SmartHubBidAdapter', function () { expect(syncData[0].url).to.equal('https://us4.shb-sync.com/image?pbjs=1&ccpa_consent=1---&coppa=0&pid=360') }); it('Should return array of objects with GPP values', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'ab12345', applicableSections: [8] }); diff --git a/test/spec/modules/smootBidAdapter_spec.js b/test/spec/modules/smootBidAdapter_spec.js index 7ab8100bbe1..e3abd218585 100644 --- a/test/spec/modules/smootBidAdapter_spec.js +++ b/test/spec/modules/smootBidAdapter_spec.js @@ -27,6 +27,7 @@ describe('SmootBidAdapter', function () { mediaTypes: { [BANNER]: { sizes: [[300, 250]], + battr: [1, 3], }, }, params: { @@ -42,6 +43,7 @@ describe('SmootBidAdapter', function () { playerSize: [[300, 300]], minduration: 5, maxduration: 60, + battr: [1, 3], }, }, params: { @@ -139,8 +141,7 @@ describe('SmootBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -171,17 +172,16 @@ describe('SmootBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -224,9 +224,6 @@ describe('SmootBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -538,7 +535,7 @@ describe('SmootBidAdapter', function () { describe('getUserSyncs', function () { it('Should return array of objects with proper sync config , include GDPR', function () { const syncData = spec.getUserSyncs( - {}, + { pixelEnabled: true }, {}, { consentString: 'ALL', @@ -557,7 +554,7 @@ describe('SmootBidAdapter', function () { }); it('Should return array of objects with proper sync config , include CCPA', function () { const syncData = spec.getUserSyncs( - {}, + { pixelEnabled: true }, {}, {}, '1---' @@ -573,7 +570,7 @@ describe('SmootBidAdapter', function () { }); it('Should return array of objects with proper sync config , include GPP', function () { const syncData = spec.getUserSyncs( - {}, + { pixelEnabled: true }, {}, {}, undefined, diff --git a/test/spec/modules/teqBlazeSalesAgentBidAdapter_spec.js b/test/spec/modules/teqBlazeSalesAgentBidAdapter_spec.js index f2dbe70f30d..974d81f458f 100644 --- a/test/spec/modules/teqBlazeSalesAgentBidAdapter_spec.js +++ b/test/spec/modules/teqBlazeSalesAgentBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('TeqBlazeSalesAgentBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('TeqBlazeSalesAgentBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -156,8 +158,7 @@ describe('TeqBlazeSalesAgentBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -187,17 +188,16 @@ describe('TeqBlazeSalesAgentBidAdapter', function () { expect(placement.axex).to.exist.and.to.be.equal('exclude'); expect(placement.axem).to.exist.and.to.be.equal('macro'); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); diff --git a/test/spec/modules/verbenBidAdapter_spec.js b/test/spec/modules/verbenBidAdapter_spec.js index 9864e9d2b70..957733888b9 100644 --- a/test/spec/modules/verbenBidAdapter_spec.js +++ b/test/spec/modules/verbenBidAdapter_spec.js @@ -22,7 +22,8 @@ describe('VerbenBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -37,7 +38,8 @@ describe('VerbenBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -148,8 +150,7 @@ describe('VerbenBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -176,17 +177,16 @@ describe('VerbenBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -225,9 +225,6 @@ describe('VerbenBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); diff --git a/test/spec/modules/visiblemeasuresBidAdapter_spec.js b/test/spec/modules/visiblemeasuresBidAdapter_spec.js index b76805e4ba0..b1539c68a25 100644 --- a/test/spec/modules/visiblemeasuresBidAdapter_spec.js +++ b/test/spec/modules/visiblemeasuresBidAdapter_spec.js @@ -24,7 +24,8 @@ describe('VisibleMeasuresBidAdapter', function () { bidder: bidder, mediaTypes: { [BANNER]: { - sizes: [[300, 250]] + sizes: [[300, 250]], + battr: [1, 3] } }, params: { @@ -39,7 +40,8 @@ describe('VisibleMeasuresBidAdapter', function () { [VIDEO]: { playerSize: [[300, 300]], minduration: 5, - maxduration: 60 + maxduration: 60, + battr: [1, 3] } }, params: { @@ -150,8 +152,7 @@ describe('VisibleMeasuresBidAdapter', function () { 'tmax', 'bcat', 'badv', - 'bapp', - 'battr' + 'bapp' ); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); @@ -178,17 +179,16 @@ describe('VisibleMeasuresBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('publisher'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); break; case VIDEO: expect(placement.playerSize).to.be.an('array'); expect(placement.minduration).to.be.an('number'); expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); break; case NATIVE: expect(placement.native).to.be.an('object'); @@ -227,9 +227,6 @@ describe('VisibleMeasuresBidAdapter', function () { expect(placement.type).to.exist.and.to.equal('network'); expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); - if (placement.adFormat === BANNER) { - expect(placement.sizes).to.be.an('array'); - } switch (placement.adFormat) { case BANNER: expect(placement.sizes).to.be.an('array'); @@ -480,7 +477,7 @@ describe('VisibleMeasuresBidAdapter', function () { describe('getUserSyncs', function() { it('Should return array of objects with proper sync config , include GDPR', function() { - const syncData = spec.getUserSyncs({}, {}, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, { consentString: 'ALL', gdprApplies: true, }, undefined); @@ -492,7 +489,7 @@ describe('VisibleMeasuresBidAdapter', function () { expect(syncData[0].url).to.equal(`${syncUrl}/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0`) }); it('Should return array of objects with proper sync config , include CCPA', function() { - const syncData = spec.getUserSyncs({}, {}, {}, '1---'); + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1---'); expect(syncData).to.be.an('array').which.is.not.empty; expect(syncData[0]).to.be.an('object') expect(syncData[0].type).to.be.a('string') @@ -501,7 +498,7 @@ describe('VisibleMeasuresBidAdapter', function () { expect(syncData[0].url).to.equal(`${syncUrl}/image?pbjs=1&ccpa_consent=1---&coppa=0`) }); it('Should return array of objects with proper sync config , include GPP', function() { - const syncData = spec.getUserSyncs({}, {}, {}, undefined, { + const syncData = spec.getUserSyncs({ pixelEnabled: true }, {}, {}, undefined, { gppString: 'abc123', applicableSections: [8] }); From bb5faa456c343e92f3e35235f6e859966f24d4e5 Mon Sep 17 00:00:00 2001 From: MaksymTeqBlaze Date: Tue, 5 May 2026 15:33:14 +0300 Subject: [PATCH 2/4] New Adapter: TeqBlaze Demo --- modules/teqBlazeDemoBidAdapter.md | 79 +++ modules/teqBlazeDemoBidAdapter.ts | 28 + .../modules/teqBlazeDemoBidAdapter_spec.js | 477 ++++++++++++++++++ 3 files changed, 584 insertions(+) create mode 100644 modules/teqBlazeDemoBidAdapter.md create mode 100644 modules/teqBlazeDemoBidAdapter.ts create mode 100644 test/spec/modules/teqBlazeDemoBidAdapter_spec.js diff --git a/modules/teqBlazeDemoBidAdapter.md b/modules/teqBlazeDemoBidAdapter.md new file mode 100644 index 00000000000..2551e9c81b1 --- /dev/null +++ b/modules/teqBlazeDemoBidAdapter.md @@ -0,0 +1,79 @@ +# Overview + +``` +Module Name: TeqBlaze Demo Bidder Adapter +Module Type: TeqBlaze Demo Bidder Adapter +Maintainer: support@teqblaze.com +``` + +# Description + +Connects to TeqBlaze Demo for bids. +TeqBlaze Demo bid adapter supports Banner, Video (instream and outstream) and Native. + +# Test Parameters +``` + var adUnits = [ + // Will return static test banner + { + code: 'adunit1', + mediaTypes: { + banner: { + sizes: [ [300, 250], [320, 50] ], + } + }, + bids: [ + { + bidder: 'tqblz_demo', + params: { + placementId: 'testBanner', + } + } + ] + }, + { + code: 'addunit2', + mediaTypes: { + video: { + playerSize: [ [640, 480] ], + context: 'instream', + minduration: 5, + maxduration: 60, + } + }, + bids: [ + { + bidder: 'tqblz_demo', + params: { + placementId: 'testVideo', + } + } + ] + }, + { + code: 'addunit3', + mediaTypes: { + native: { + title: { + required: true + }, + body: { + required: true + }, + icon: { + required: true, + size: [64, 64] + } + } + }, + bids: [ + { + bidder: 'tqblz_demo', + params: { + placementId: 'testNative', + } + } + ] + } + ]; +``` diff --git a/modules/teqBlazeDemoBidAdapter.ts b/modules/teqBlazeDemoBidAdapter.ts new file mode 100644 index 00000000000..37d2b663cd4 --- /dev/null +++ b/modules/teqBlazeDemoBidAdapter.ts @@ -0,0 +1,28 @@ +import { BidderSpec, registerBidder } from '../src/adapters/bidderFactory.js'; +import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; +import { + buildRequests, + interpretResponse, + isBidRequestValid, + type TeqBlazeBidParams +} from '../libraries/teqblazeUtils/bidderUtils.ts'; + +const BIDDER_CODE = 'tqblz_demo'; +const AD_URL = 'https://test-ssp-node-1.teqblaze.com/pbjs'; + +declare module '../src/adUnits' { + interface BidderParams { + [BIDDER_CODE]: TeqBlazeBidParams; + } +} + +export const spec: BidderSpec = { + code: BIDDER_CODE, + supportedMediaTypes: [BANNER, VIDEO, NATIVE], + + isBidRequestValid: isBidRequestValid(), + buildRequests: buildRequests(AD_URL), + interpretResponse +}; + +registerBidder(spec); diff --git a/test/spec/modules/teqBlazeDemoBidAdapter_spec.js b/test/spec/modules/teqBlazeDemoBidAdapter_spec.js new file mode 100644 index 00000000000..3cd34904602 --- /dev/null +++ b/test/spec/modules/teqBlazeDemoBidAdapter_spec.js @@ -0,0 +1,477 @@ +import { expect } from 'chai'; +import { spec } from '../../../modules/teqBlazeDemoBidAdapter.js'; +import { BANNER, VIDEO, NATIVE } from '../../../src/mediaTypes.js'; +import { getUniqueIdentifierStr } from '../../../src/utils.js'; + +const bidder = 'tqblz_demo'; + +describe('TeqBlazeDemoBidAdapter', function () { + const userIdAsEids = [{ + source: 'test.org', + uids: [{ + id: '01**********', + atype: 1, + ext: { + third: '01***********' + } + }] + }]; + const bids = [ + { + bidId: getUniqueIdentifierStr(), + bidder: bidder, + mediaTypes: { + [BANNER]: { + sizes: [[300, 250]], + battr: [1, 3] + } + }, + params: { + placementId: 'testBanner' + }, + userIdAsEids + }, + { + bidId: getUniqueIdentifierStr(), + bidder: bidder, + mediaTypes: { + [VIDEO]: { + playerSize: [[300, 300]], + minduration: 5, + maxduration: 60, + battr: [1, 3] + } + }, + params: { + placementId: 'testVideo' + }, + userIdAsEids + }, + { + bidId: getUniqueIdentifierStr(), + bidder: bidder, + mediaTypes: { + [NATIVE]: { + native: { + title: { + required: true + }, + body: { + required: true + }, + icon: { + required: true, + size: [64, 64] + } + } + } + }, + params: { + placementId: 'testNative' + }, + userIdAsEids + } + ]; + + const invalidBid = { + bidId: getUniqueIdentifierStr(), + bidder: bidder, + mediaTypes: { + [BANNER]: { + sizes: [[300, 250]] + } + }, + params: { + + } + } + + const bidderRequest = { + uspConsent: '1---', + gdprConsent: { + consentString: 'COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw', + vendorData: {} + }, + refererInfo: { + referer: 'https://test.com', + page: 'https://test.com' + }, + ortb2: { + device: { + w: 1512, + h: 982, + language: 'en-UK' + } + }, + timeout: 500 + }; + + describe('isBidRequestValid', function () { + it('Should return true if there are bidId, params and key parameters present', function () { + expect(spec.isBidRequestValid(bids[0])).to.be.true; + }); + it('Should return false if at least one of parameters is not present', function () { + expect(spec.isBidRequestValid(invalidBid)).to.be.false; + }); + }); + + describe('buildRequests', function () { + let serverRequest = spec.buildRequests(bids, bidderRequest); + + it('Creates a ServerRequest object with method, URL and data', function () { + expect(serverRequest).to.exist; + expect(serverRequest.method).to.exist; + expect(serverRequest.url).to.exist; + expect(serverRequest.data).to.exist; + }); + + it('Returns POST method', function () { + expect(serverRequest.method).to.equal('POST'); + }); + + it('Returns valid URL', function () { + expect(serverRequest.url).to.equal('https://test-ssp-node-1.teqblaze.com/pbjs'); + }); + + it('Returns general data valid', function () { + const data = serverRequest.data; + expect(data).to.be.an('object'); + expect(data).to.have.all.keys('deviceWidth', + 'deviceHeight', + 'device', + 'language', + 'secure', + 'host', + 'page', + 'placements', + 'coppa', + 'ccpa', + 'gdpr', + 'tmax', + 'bcat', + 'badv', + 'bapp' + ); + expect(data.deviceWidth).to.be.a('number'); + expect(data.deviceHeight).to.be.a('number'); + expect(data.language).to.be.a('string'); + expect(data.secure).to.be.within(0, 1); + expect(data.host).to.be.a('string'); + expect(data.page).to.be.a('string'); + expect(data.coppa).to.be.a('number'); + expect(data.gdpr).to.be.a('object'); + expect(data.ccpa).to.be.a('string'); + expect(data.tmax).to.be.a('number'); + expect(data.placements).to.have.lengthOf(3); + }); + + it('Returns valid placements', function () { + const { placements } = serverRequest.data; + for (let i = 0, len = placements.length; i < len; i++) { + const placement = placements[i]; + expect(placement.placementId).to.be.oneOf(['testBanner', 'testVideo', 'testNative']); + expect(placement.adFormat).to.be.oneOf([BANNER, VIDEO, NATIVE]); + expect(placement.bidId).to.be.a('string'); + expect(placement.schain).to.be.an('object'); + expect(placement.bidfloor).to.exist.and.to.equal(0); + expect(placement.type).to.exist.and.to.equal('publisher'); + expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); + + switch (placement.adFormat) { + case BANNER: + expect(placement.sizes).to.be.an('array'); + expect(placement.battr).to.deep.equal([1, 3]); + break; + case VIDEO: + expect(placement.playerSize).to.be.an('array'); + expect(placement.minduration).to.be.an('number'); + expect(placement.maxduration).to.be.an('number'); + expect(placement.battr).to.deep.equal([1, 3]); + break; + case NATIVE: + expect(placement.native).to.be.an('object'); + break; + } + } + }); + + it('Returns valid endpoints', function () { + const bids = [ + { + bidId: getUniqueIdentifierStr(), + bidder: bidder, + mediaTypes: { + [BANNER]: { + sizes: [[300, 250]] + } + }, + params: { + endpointId: 'testBanner', + }, + userIdAsEids + } + ]; + + const serverRequest = spec.buildRequests(bids, bidderRequest); + + const { placements } = serverRequest.data; + for (let i = 0, len = placements.length; i < len; i++) { + const placement = placements[i]; + expect(placement.endpointId).to.be.oneOf(['testBanner', 'testVideo', 'testNative']); + expect(placement.adFormat).to.be.oneOf([BANNER, VIDEO, NATIVE]); + expect(placement.bidId).to.be.a('string'); + expect(placement.schain).to.be.an('object'); + expect(placement.bidfloor).to.exist.and.to.equal(0); + expect(placement.type).to.exist.and.to.equal('network'); + expect(placement.eids).to.exist.and.to.be.deep.equal(userIdAsEids); + + switch (placement.adFormat) { + case BANNER: + expect(placement.sizes).to.be.an('array'); + break; + case VIDEO: + expect(placement.playerSize).to.be.an('array'); + expect(placement.minduration).to.be.an('number'); + expect(placement.maxduration).to.be.an('number'); + break; + case NATIVE: + expect(placement.native).to.be.an('object'); + break; + } + } + }); + + it('Returns data with gdprConsent and without uspConsent', function () { + delete bidderRequest.uspConsent; + serverRequest = spec.buildRequests(bids, bidderRequest); + const data = serverRequest.data; + expect(data.gdpr).to.exist; + expect(data.gdpr).to.be.a('object'); + expect(data.gdpr).to.have.property('consentString'); + expect(data.gdpr).to.not.have.property('vendorData'); + expect(data.gdpr.consentString).to.equal(bidderRequest.gdprConsent.consentString); + expect(data.ccpa).to.not.exist; + delete bidderRequest.gdprConsent; + }); + + it('Returns data with uspConsent and without gdprConsent', function () { + bidderRequest.uspConsent = '1---'; + delete bidderRequest.gdprConsent; + serverRequest = spec.buildRequests(bids, bidderRequest); + const data = serverRequest.data; + expect(data.ccpa).to.exist; + expect(data.ccpa).to.be.a('string'); + expect(data.ccpa).to.equal(bidderRequest.uspConsent); + expect(data.gdpr).to.not.exist; + }); + }); + + describe('gpp consent', function () { + it('bidderRequest.gppConsent', () => { + bidderRequest.gppConsent = { + gppString: 'abc123', + applicableSections: [8] + }; + + const serverRequest = spec.buildRequests(bids, bidderRequest); + const data = serverRequest.data; + expect(data).to.be.an('object'); + expect(data).to.have.property('gpp'); + expect(data).to.have.property('gpp_sid'); + + delete bidderRequest.gppConsent; + }) + + it('bidderRequest.ortb2.regs.gpp', () => { + bidderRequest.ortb2 = bidderRequest.ortb2 || {}; + bidderRequest.ortb2.regs = bidderRequest.ortb2.regs || {}; + bidderRequest.ortb2.regs.gpp = 'abc123'; + bidderRequest.ortb2.regs.gpp_sid = [8]; + + const serverRequest = spec.buildRequests(bids, bidderRequest); + const data = serverRequest.data; + expect(data).to.be.an('object'); + expect(data).to.have.property('gpp'); + expect(data).to.have.property('gpp_sid'); + + expect(bidderRequest).to.have.property('ortb2'); + }) + }); + + describe('interpretResponse', function () { + it('Should interpret banner response', function () { + const banner = { + body: [{ + mediaType: 'banner', + width: 300, + height: 250, + cpm: 0.4, + ad: 'Test', + requestId: '23fhj33i987f', + ttl: 120, + creativeId: '2', + netRevenue: true, + currency: 'USD', + dealId: '1', + meta: { + advertiserDomains: ['google.com'], + advertiserId: 1234 + } + }] + }; + const bannerResponses = spec.interpretResponse(banner); + expect(bannerResponses).to.be.an('array').that.is.not.empty; + const dataItem = bannerResponses[0]; + expect(dataItem).to.have.all.keys('requestId', 'cpm', 'width', 'height', 'ad', 'ttl', 'creativeId', + 'netRevenue', 'currency', 'dealId', 'mediaType', 'meta'); + expect(dataItem.requestId).to.equal(banner.body[0].requestId); + expect(dataItem.cpm).to.equal(banner.body[0].cpm); + expect(dataItem.width).to.equal(banner.body[0].width); + expect(dataItem.height).to.equal(banner.body[0].height); + expect(dataItem.ad).to.equal(banner.body[0].ad); + expect(dataItem.ttl).to.equal(banner.body[0].ttl); + expect(dataItem.creativeId).to.equal(banner.body[0].creativeId); + expect(dataItem.netRevenue).to.be.true; + expect(dataItem.currency).to.equal(banner.body[0].currency); + expect(dataItem.meta).to.be.an('object').that.has.any.key('advertiserDomains'); + }); + it('Should interpret video response', function () { + const video = { + body: [{ + vastUrl: 'test.com', + mediaType: 'video', + cpm: 0.5, + requestId: '23fhj33i987f', + ttl: 120, + creativeId: '2', + netRevenue: true, + currency: 'USD', + dealId: '1', + meta: { + advertiserDomains: ['google.com'], + advertiserId: 1234 + } + }] + }; + const videoResponses = spec.interpretResponse(video); + expect(videoResponses).to.be.an('array').that.is.not.empty; + + const dataItem = videoResponses[0]; + expect(dataItem).to.have.all.keys('requestId', 'cpm', 'vastUrl', 'ttl', 'creativeId', + 'netRevenue', 'currency', 'dealId', 'mediaType', 'meta'); + expect(dataItem.requestId).to.equal('23fhj33i987f'); + expect(dataItem.cpm).to.equal(0.5); + expect(dataItem.vastUrl).to.equal('test.com'); + expect(dataItem.ttl).to.equal(120); + expect(dataItem.creativeId).to.equal('2'); + expect(dataItem.netRevenue).to.be.true; + expect(dataItem.currency).to.equal('USD'); + expect(dataItem.meta).to.be.an('object').that.has.any.key('advertiserDomains'); + }); + it('Should interpret native response', function () { + const native = { + body: [{ + mediaType: 'native', + native: { + clickUrl: 'test.com', + title: 'Test', + image: 'test.com', + impressionTrackers: ['test.com'], + }, + ttl: 120, + cpm: 0.4, + requestId: '23fhj33i987f', + creativeId: '2', + netRevenue: true, + currency: 'USD', + meta: { + advertiserDomains: ['google.com'], + advertiserId: 1234 + } + }] + }; + const nativeResponses = spec.interpretResponse(native); + expect(nativeResponses).to.be.an('array').that.is.not.empty; + + const dataItem = nativeResponses[0]; + expect(dataItem).to.have.keys('requestId', 'cpm', 'ttl', 'creativeId', 'netRevenue', 'currency', 'mediaType', 'native', 'meta'); + expect(dataItem.native).to.have.keys('clickUrl', 'impressionTrackers', 'title', 'image') + expect(dataItem.requestId).to.equal('23fhj33i987f'); + expect(dataItem.cpm).to.equal(0.4); + expect(dataItem.native.clickUrl).to.equal('test.com'); + expect(dataItem.native.title).to.equal('Test'); + expect(dataItem.native.image).to.equal('test.com'); + expect(dataItem.native.impressionTrackers).to.be.an('array').that.is.not.empty; + expect(dataItem.native.impressionTrackers[0]).to.equal('test.com'); + expect(dataItem.ttl).to.equal(120); + expect(dataItem.creativeId).to.equal('2'); + expect(dataItem.netRevenue).to.be.true; + expect(dataItem.currency).to.equal('USD'); + expect(dataItem.meta).to.be.an('object').that.has.any.key('advertiserDomains'); + }); + it('Should return an empty array if invalid banner response is passed', function () { + const invBanner = { + body: [{ + width: 300, + cpm: 0.4, + ad: 'Test', + requestId: '23fhj33i987f', + ttl: 120, + creativeId: '2', + netRevenue: true, + currency: 'USD', + dealId: '1' + }] + }; + + const serverResponses = spec.interpretResponse(invBanner); + expect(serverResponses).to.be.an('array').that.is.empty; + }); + it('Should return an empty array if invalid video response is passed', function () { + const invVideo = { + body: [{ + mediaType: 'video', + cpm: 0.5, + requestId: '23fhj33i987f', + ttl: 120, + creativeId: '2', + netRevenue: true, + currency: 'USD', + dealId: '1' + }] + }; + const serverResponses = spec.interpretResponse(invVideo); + expect(serverResponses).to.be.an('array').that.is.empty; + }); + it('Should return an empty array if invalid native response is passed', function () { + const invNative = { + body: [{ + mediaType: 'native', + clickUrl: 'test.com', + title: 'Test', + impressionTrackers: ['test.com'], + ttl: 120, + requestId: '23fhj33i987f', + creativeId: '2', + netRevenue: true, + currency: 'USD', + }] + }; + const serverResponses = spec.interpretResponse(invNative); + expect(serverResponses).to.be.an('array').that.is.empty; + }); + it('Should return an empty array if invalid response is passed', function () { + const invalid = { + body: [{ + ttl: 120, + creativeId: '2', + netRevenue: true, + currency: 'USD', + dealId: '1' + }] + }; + const serverResponses = spec.interpretResponse(invalid); + expect(serverResponses).to.be.an('array').that.is.empty; + }); + }); +}); From 3b3a9710151a69a66ce22d4ed6def9aa5414f8ca Mon Sep 17 00:00:00 2001 From: MaksymTeqBlaze Date: Tue, 5 May 2026 16:27:09 +0300 Subject: [PATCH 3/4] update readme --- modules/teqBlazeDemoBidAdapter.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/teqBlazeDemoBidAdapter.md b/modules/teqBlazeDemoBidAdapter.md index 2551e9c81b1..446b10866fe 100644 --- a/modules/teqBlazeDemoBidAdapter.md +++ b/modules/teqBlazeDemoBidAdapter.md @@ -9,7 +9,8 @@ Maintainer: support@teqblaze.com # Description Connects to TeqBlaze Demo for bids. -TeqBlaze Demo bid adapter supports Banner, Video (instream and outstream) and Native. +TeqBlaze Demo bid adapter supports Banner, Video (instream and outstream) and Native. \ +This adapter is for internal testing only and should not be used for production integrations. # Test Parameters ``` From 0ed6e9a08e1fe413870431b63c1fc6d4f3cd4560 Mon Sep 17 00:00:00 2001 From: Patrick McCann Date: Tue, 5 May 2026 09:28:49 -0400 Subject: [PATCH 4/4] Fix formatting in TeqBlaze Demo Bid Adapter documentation --- modules/teqBlazeDemoBidAdapter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/teqBlazeDemoBidAdapter.md b/modules/teqBlazeDemoBidAdapter.md index 446b10866fe..fd1fe43f92e 100644 --- a/modules/teqBlazeDemoBidAdapter.md +++ b/modules/teqBlazeDemoBidAdapter.md @@ -9,7 +9,7 @@ Maintainer: support@teqblaze.com # Description Connects to TeqBlaze Demo for bids. -TeqBlaze Demo bid adapter supports Banner, Video (instream and outstream) and Native. \ +TeqBlaze Demo bid adapter supports Banner, Video (instream and outstream) and Native. This adapter is for internal testing only and should not be used for production integrations. # Test Parameters