prebid.js 8.8.0 → 8.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/1plusXRtdProvider.js +1 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/adWMGAnalyticsAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adkernelAdnAnalyticsAdapter.js +1 -1
- package/dist/adlooxAdServerVideo.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/admixerIdSystem.js +1 -1
- package/dist/adnuntiusRtdProvider.js +1 -1
- package/dist/adpartnerBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adqueryIdSystem.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adriverIdSystem.js +1 -1
- package/dist/adtelligentIdSystem.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgAnalyticsAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adxpremiumAnalyticsAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/aidemBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/akamaiDapRtdProvider.js +1 -1
- package/dist/alkimiBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/analyticsAdapter.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/atsAnalyticsAdapter.js +1 -1
- package/dist/automatadBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/bidwatchAnalyticsAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/brightcomSSPBidAdapter.js +1 -1
- package/dist/britepoolIdSystem.js +1 -1
- package/dist/browsiRtdProvider.js +1 -1
- package/dist/byDataAnalyticsAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/categoryTranslation.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/colossussspBidAdapter.js +1 -1
- package/dist/concertAnalyticsAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectIdSystem.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/criteoIdSystem.js +1 -1
- package/dist/currency.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dacIdSystem.js +1 -1
- package/dist/dailyhuntBidAdapter.js +1 -1
- package/dist/datablocksBidAdapter.js +1 -1
- package/dist/dgkeywordRtdProvider.js +1 -1
- package/dist/dmdIdSystem.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningAnalyticsAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/fabrickIdSystem.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/fintezaAnalyticsAdapter.js +1 -1
- package/dist/fledgeForGpt.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/genericAnalyticsAdapter.js +1 -1
- package/dist/geoedgeRtdProvider.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/gnetBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/growthCodeAnalyticsAdapter.js +1 -1
- package/dist/growthCodeIdSystem.js +1 -1
- package/dist/growthCodeRtdProvider.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hadronAnalyticsAdapter.js +1 -1
- package/dist/hadronIdSystem.js +1 -1
- package/dist/hadronRtdProvider.js +1 -1
- package/dist/hypelabBidAdapter.js +1 -1
- package/dist/iasRtdProvider.js +1 -1
- package/dist/id5AnalyticsAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/idImportLibrary.js +1 -1
- package/dist/identityLinkIdSystem.js +1 -1
- package/dist/imRtdProvider.js +1 -1
- package/dist/imdsBidAdapter.js +1 -1
- package/dist/impactifyBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/imuIdSystem.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/intentIqIdSystem.js +1 -1
- package/dist/invisiblyAnalyticsAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/jwplayerRtdProvider.js +1 -1
- package/dist/kargoAnalyticsAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/kinessoIdSystem.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/konduitWrapper.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/kulturemediaBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/limelightDigitalBidAdapter.js +1 -1
- package/dist/liveIntentAnalyticsAdapter.js +1 -1
- package/dist/liveIntentIdSystem.js +1 -1
- package/dist/livewrappedAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/lotamePanoramaIdSystem.js +1 -1
- package/dist/luponmediaBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/mantisBidAdapter.js +1 -1
- package/dist/marsmediaAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/medianetAnalyticsAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/merkleIdSystem.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/mgidRtdProvider.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/mspa.js +1 -1
- package/dist/mwOpenLinkIdSystem.js +1 -1
- package/dist/naveggIdSystem.js +1 -1
- package/dist/neuwoRtdProvider.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +240 -240
- package/dist/novatiqIdSystem.js +1 -1
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/open8BidAdapter.js +1 -1
- package/dist/operaadsIdSystem.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/optimeraRtdProvider.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/oxxionAnalyticsAdapter.js +1 -1
- package/dist/oxxionRtdProvider.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +2 -2
- package/dist/prebidServerBidAdapter.js +1 -1
- package/dist/prebidmanagerAnalyticsAdapter.js +1 -1
- package/dist/priceFloors.js +1 -1
- package/dist/prismaBidAdapter.js +1 -1
- package/dist/pubgeniusBidAdapter.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticAnalyticsAdapter.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pubxaiAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/qwarryBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/reconciliationRtdProvider.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/relevadRtdProvider.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rivrAnalyticsAdapter.js +1 -1
- package/dist/roxotAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/scaleableAnalyticsAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/silverpushBidAdapter.js +1 -1
- package/dist/sirdataRtdProvider.js +1 -1
- package/dist/slimcutBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smartyadsBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiAnalyticsAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/staqAnalyticsAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.js +1 -1
- package/dist/talkadsBidAdapter.js +1 -1
- package/dist/tapadIdSystem.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/teadsIdSystem.js +1 -1
- package/dist/terceptAnalyticsAdapter.js +1 -1
- package/dist/timeoutRtdProvider.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/uid2IdSystem.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/unifiedIdSystem.js +1 -1
- package/dist/verizonMediaIdSystem.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vrtcalBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/weboramaRtdProvider.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/dist/yuktamediaAnalyticsAdapter.js +1 -1
- package/dist/zeta_global_sspAnalyticsAdapter.js +1 -1
- package/dist/zeta_global_sspBidAdapter.js +1 -1
- package/integrationExamples/gpt/growthcode.html +3 -12
- package/libraries/mspa/activityControls.js +3 -1
- package/modules/adagioBidAdapter.js +11 -3
- package/modules/concertBidAdapter.js +1 -0
- package/modules/fledgeForGpt.js +17 -4
- package/modules/fledgeForGpt.md +17 -10
- package/modules/geoedgeRtdProvider.js +1 -5
- package/modules/growthCodeAnalyticsAdapter.js +7 -4
- package/modules/growthCodeAnalyticsAdapter.md +1 -7
- package/modules/nexx360BidAdapter.js +7 -1
- package/modules/prebidServerBidAdapter/index.js +8 -2
- package/modules/pubmaticAnalyticsAdapter.js +16 -3
- package/package.json +1 -1
- package/src/adapters/bidderFactory.js +14 -5
- package/src/ajax.js +126 -87
- package/src/constants.json +8 -2
- package/src/native.js +12 -1
- package/test/mocks/xhr.js +256 -9
- package/test/spec/libraries/mspa/activityControls_spec.js +6 -0
- package/test/spec/modules/adagioBidAdapter_spec.js +15 -0
- package/test/spec/modules/adlooxAdServerVideo_spec.js +1 -5
- package/test/spec/modules/adlooxRtdProvider_spec.js +1 -5
- package/test/spec/modules/categoryTranslation_spec.js +7 -9
- package/test/spec/modules/concertBidAdapter_spec.js +1 -1
- package/test/spec/modules/conversantAnalyticsAdapter_spec.js +3 -5
- package/test/spec/modules/currency_spec.js +2 -2
- package/test/spec/modules/dmdIdSystem_spec.js +2 -2
- package/test/spec/modules/euidIdSystem_spec.js +10 -9
- package/test/spec/modules/feedadBidAdapter_spec.js +1 -1
- package/test/spec/modules/fledge_spec.js +117 -43
- package/test/spec/modules/geoedgeRtdProvider_spec.js +11 -18
- package/test/spec/modules/greenbidsRtdProvider_spec.js +3 -12
- package/test/spec/modules/growthCodeAnalyticsAdapter_spec.js +0 -1
- package/test/spec/modules/hadronIdSystem_spec.js +1 -1
- package/test/spec/modules/id5AnalyticsAdapter_spec.js +1 -7
- package/test/spec/modules/id5IdSystem_spec.js +25 -25
- package/test/spec/modules/identityLinkIdSystem_spec.js +0 -2
- package/test/spec/modules/intentIqIdSystem_spec.js +0 -2
- package/test/spec/modules/invisiblyAnalyticsAdapter_spec.js +2 -6
- package/test/spec/modules/jwplayerRtdProvider_spec.js +26 -28
- package/test/spec/modules/magniteAnalyticsAdapter_spec.js +2 -2
- package/test/spec/modules/mgidRtdProvider_spec.js +1 -5
- package/test/spec/modules/nexx360BidAdapter_spec.js +48 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +5 -19
- package/test/spec/modules/ooloAnalyticsAdapter_spec.js +1 -1
- package/test/spec/modules/prebidServerBidAdapter_spec.js +33 -2
- package/test/spec/modules/priceFloors_spec.js +33 -37
- package/test/spec/modules/publinkIdSystem_spec.js +1 -1
- package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +102 -18
- package/test/spec/modules/pubwiseAnalyticsAdapter_spec.js +2 -8
- package/test/spec/modules/teadsIdSystem_spec.js +1 -1
- package/test/spec/modules/uid2IdSystem_helpers.js +5 -5
- package/test/spec/modules/uid2IdSystem_spec.js +24 -24
- package/test/spec/modules/userId_spec.js +1 -1
- package/test/spec/modules/zeta_global_sspAnalyticsAdapter_spec.js +2 -5
- package/test/spec/native_spec.js +15 -2
- package/test/spec/unit/core/ajax_spec.js +403 -0
- package/test/spec/unit/core/bidderFactory_spec.js +80 -8
- package/test/spec/videoCache_spec.js +4 -4
|
@@ -35,6 +35,12 @@ describe('Consent interpretation', () => {
|
|
|
35
35
|
}));
|
|
36
36
|
expect(result).to.equal(true);
|
|
37
37
|
});
|
|
38
|
+
it('should be true (basic consent conditions do not pass) with covered set to zero (invalid state)', () => {
|
|
39
|
+
const result = isBasicConsentDenied(mkConsent({
|
|
40
|
+
MspaCoveredTransaction: 0
|
|
41
|
+
}));
|
|
42
|
+
expect(result).to.equal(true);
|
|
43
|
+
});
|
|
38
44
|
it('should not deny when consent for under-13 is null', () => {
|
|
39
45
|
expect(isBasicConsentDenied(mkConsent({
|
|
40
46
|
KnownChildSensitiveDataConsents: [0, null]
|
|
@@ -322,6 +322,21 @@ describe('Adagio bid adapter', () => {
|
|
|
322
322
|
expect(requests[0].data.adUnits[0].transactionId).to.not.exist;
|
|
323
323
|
});
|
|
324
324
|
|
|
325
|
+
it('should enrich prebid bid requests params', function() {
|
|
326
|
+
const expectedAuctionId = '373bcda7-9794-4f1c-be2c-0d223d11d579'
|
|
327
|
+
const expectedPageviewId = '56befc26-8cf0-472d-b105-73896df8eb89';
|
|
328
|
+
sandbox.stub(utils, 'generateUUID').returns(expectedAuctionId);
|
|
329
|
+
sandbox.stub(adagio, 'getPageviewId').returns(expectedPageviewId);
|
|
330
|
+
|
|
331
|
+
const bid01 = new BidRequestBuilder().withParams().build();
|
|
332
|
+
const bidderRequest = new BidderRequestBuilder().build();
|
|
333
|
+
|
|
334
|
+
spec.buildRequests([bid01], bidderRequest);
|
|
335
|
+
|
|
336
|
+
expect(bid01.params.adagioAuctionId).eq(expectedAuctionId);
|
|
337
|
+
expect(bid01.params.pageviewId).eq(expectedPageviewId);
|
|
338
|
+
});
|
|
339
|
+
|
|
325
340
|
it('should enqueue computed features for collect usage', function() {
|
|
326
341
|
sandbox.stub(Date, 'now').returns(12345);
|
|
327
342
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import adapterManager from 'src/adapterManager.js';
|
|
2
2
|
import analyticsAdapter from 'modules/adlooxAnalyticsAdapter.js';
|
|
3
|
-
import { ajax } from 'src/ajax.js';
|
|
4
3
|
import { buildVideoUrl } from 'modules/adlooxAdServerVideo.js';
|
|
5
4
|
import { expect } from 'chai';
|
|
6
5
|
import * as events from 'src/events.js';
|
|
7
6
|
import { targeting } from 'src/targeting.js';
|
|
8
7
|
import * as utils from 'src/utils.js';
|
|
8
|
+
import {server} from '../../mocks/xhr.js';
|
|
9
9
|
|
|
10
10
|
const analyticsAdapterName = 'adloox';
|
|
11
11
|
|
|
@@ -199,11 +199,9 @@ describe('Adloox Ad Server Video', function () {
|
|
|
199
199
|
});
|
|
200
200
|
|
|
201
201
|
describe('process VAST', function () {
|
|
202
|
-
let server = null;
|
|
203
202
|
let BID = null;
|
|
204
203
|
let getWinningBidsStub;
|
|
205
204
|
beforeEach(function () {
|
|
206
|
-
server = sinon.createFakeServer();
|
|
207
205
|
BID = utils.deepClone(bid);
|
|
208
206
|
getWinningBidsStub = sinon.stub(targeting, 'getWinningBids')
|
|
209
207
|
getWinningBidsStub.withArgs(adUnit.code).returns([ BID ]);
|
|
@@ -212,8 +210,6 @@ describe('Adloox Ad Server Video', function () {
|
|
|
212
210
|
getWinningBidsStub.restore();
|
|
213
211
|
getWinningBidsStub = undefined;
|
|
214
212
|
BID = null;
|
|
215
|
-
server.restore();
|
|
216
|
-
server = null;
|
|
217
213
|
});
|
|
218
214
|
|
|
219
215
|
it('should return URL unchanged for non-VAST', function (done) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import adapterManager from 'src/adapterManager.js';
|
|
2
2
|
import analyticsAdapter from 'modules/adlooxAnalyticsAdapter.js';
|
|
3
3
|
import {auctionManager} from 'src/auctionManager.js';
|
|
4
|
-
import { config as _config } from 'src/config.js';
|
|
5
4
|
import { expect } from 'chai';
|
|
6
5
|
import * as events from 'src/events.js';
|
|
7
6
|
import * as prebidGlobal from 'src/prebidGlobal.js';
|
|
8
7
|
import { subModuleObj as rtdProvider } from 'modules/adlooxRtdProvider.js';
|
|
9
8
|
import * as utils from 'src/utils.js';
|
|
9
|
+
import {server} from '../../mocks/xhr.js';
|
|
10
10
|
|
|
11
11
|
const analyticsAdapterName = 'adloox';
|
|
12
12
|
|
|
@@ -139,16 +139,12 @@ describe('Adloox RTD Provider', function () {
|
|
|
139
139
|
expect(analyticsAdapter.context).is.null;
|
|
140
140
|
});
|
|
141
141
|
|
|
142
|
-
let server = null;
|
|
143
142
|
let CONFIG = null;
|
|
144
143
|
beforeEach(function () {
|
|
145
|
-
server = sinon.createFakeServer();
|
|
146
144
|
CONFIG = utils.deepClone(config);
|
|
147
145
|
});
|
|
148
146
|
afterEach(function () {
|
|
149
147
|
CONFIG = null;
|
|
150
|
-
server.restore();
|
|
151
|
-
server = null;
|
|
152
148
|
});
|
|
153
149
|
|
|
154
150
|
it('should fetch segments', function (done) {
|
|
@@ -2,18 +2,16 @@ import { getAdserverCategoryHook, initTranslation, storage } from 'modules/categ
|
|
|
2
2
|
import { config } from 'src/config.js';
|
|
3
3
|
import * as utils from 'src/utils.js';
|
|
4
4
|
import { expect } from 'chai';
|
|
5
|
+
import {server} from '../../mocks/xhr.js';
|
|
5
6
|
|
|
6
7
|
describe('category translation', function () {
|
|
7
|
-
let fakeTranslationServer;
|
|
8
8
|
let getLocalStorageStub;
|
|
9
9
|
|
|
10
10
|
beforeEach(function () {
|
|
11
|
-
fakeTranslationServer = sinon.fakeServer.create();
|
|
12
11
|
getLocalStorageStub = sinon.stub(storage, 'getDataFromLocalStorage');
|
|
13
12
|
});
|
|
14
13
|
|
|
15
14
|
afterEach(function() {
|
|
16
|
-
fakeTranslationServer.reset();
|
|
17
15
|
getLocalStorageStub.restore();
|
|
18
16
|
config.resetConfig();
|
|
19
17
|
});
|
|
@@ -73,7 +71,7 @@ describe('category translation', function () {
|
|
|
73
71
|
}
|
|
74
72
|
}));
|
|
75
73
|
initTranslation();
|
|
76
|
-
expect(
|
|
74
|
+
expect(server.requests.length).to.equal(0);
|
|
77
75
|
clock.restore();
|
|
78
76
|
});
|
|
79
77
|
|
|
@@ -86,15 +84,15 @@ describe('category translation', function () {
|
|
|
86
84
|
}
|
|
87
85
|
}));
|
|
88
86
|
initTranslation();
|
|
89
|
-
expect(
|
|
87
|
+
expect(server.requests.length).to.equal(1);
|
|
90
88
|
clock.restore();
|
|
91
89
|
});
|
|
92
90
|
|
|
93
91
|
it('should use default mapping file if publisher has not defined in config', function () {
|
|
94
92
|
getLocalStorageStub.returns(null);
|
|
95
93
|
initTranslation('http://sample.com', 'somekey');
|
|
96
|
-
expect(
|
|
97
|
-
expect(
|
|
94
|
+
expect(server.requests.length).to.equal(1);
|
|
95
|
+
expect(server.requests[0].url).to.equal('http://sample.com/');
|
|
98
96
|
});
|
|
99
97
|
|
|
100
98
|
it('should use publisher defined mapping file', function () {
|
|
@@ -105,7 +103,7 @@ describe('category translation', function () {
|
|
|
105
103
|
});
|
|
106
104
|
getLocalStorageStub.returns(null);
|
|
107
105
|
initTranslation('http://sample.com', 'somekey');
|
|
108
|
-
expect(
|
|
109
|
-
expect(
|
|
106
|
+
expect(server.requests.length).to.equal(2);
|
|
107
|
+
expect(server.requests[0].url).to.equal('http://sample.com/');
|
|
110
108
|
});
|
|
111
109
|
});
|
|
@@ -116,7 +116,7 @@ describe('ConcertAdapter', function () {
|
|
|
116
116
|
expect(payload).to.have.property('meta');
|
|
117
117
|
expect(payload).to.have.property('slots');
|
|
118
118
|
|
|
119
|
-
const metaRequiredFields = ['prebidVersion', 'pageUrl', 'screen', 'debug', 'uid', 'optedOut', 'adapterVersion', 'uspConsent', 'gdprConsent', 'gppConsent'];
|
|
119
|
+
const metaRequiredFields = ['prebidVersion', 'pageUrl', 'screen', 'debug', 'uid', 'optedOut', 'adapterVersion', 'uspConsent', 'gdprConsent', 'gppConsent', 'browserLanguage'];
|
|
120
120
|
const slotsRequiredFields = ['name', 'bidId', 'transactionId', 'sizes', 'partnerId', 'slotType'];
|
|
121
121
|
|
|
122
122
|
metaRequiredFields.forEach(function(field) {
|
|
@@ -3,6 +3,7 @@ import {expect} from 'chai';
|
|
|
3
3
|
import {default as conversantAnalytics, CNVR_CONSTANTS, cnvrHelper} from 'modules/conversantAnalyticsAdapter';
|
|
4
4
|
import * as utils from 'src/utils.js';
|
|
5
5
|
import * as prebidGlobal from 'src/prebidGlobal';
|
|
6
|
+
import {server} from '../../mocks/xhr.js';
|
|
6
7
|
|
|
7
8
|
import constants from 'src/constants.json'
|
|
8
9
|
|
|
@@ -10,14 +11,13 @@ let events = require('src/events');
|
|
|
10
11
|
|
|
11
12
|
describe('Conversant analytics adapter tests', function() {
|
|
12
13
|
let sandbox; // sinon sandbox to make restoring all stubbed objects easier
|
|
13
|
-
let xhr; // xhr stub from sinon for capturing data sent via ajax
|
|
14
14
|
let clock; // clock stub from sinon to mock our cache cleanup interval
|
|
15
15
|
let logInfoStub;
|
|
16
16
|
|
|
17
17
|
const PREBID_VERSION = '1.2';
|
|
18
18
|
const SITE_ID = 108060;
|
|
19
19
|
|
|
20
|
-
let requests
|
|
20
|
+
let requests;
|
|
21
21
|
const DATESTAMP = Date.now();
|
|
22
22
|
|
|
23
23
|
const VALID_CONFIGURATION = {
|
|
@@ -36,10 +36,9 @@ describe('Conversant analytics adapter tests', function() {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
beforeEach(function () {
|
|
39
|
+
requests = server.requests;
|
|
39
40
|
sandbox = sinon.sandbox.create();
|
|
40
41
|
sandbox.stub(events, 'getEvents').returns([]); // need to stub this otherwise unwanted events seem to get fired during testing
|
|
41
|
-
xhr = sandbox.useFakeXMLHttpRequest(); // allows us to capture ajax requests
|
|
42
|
-
xhr.onCreate = function (req) { requests.push(req); }; // save ajax requests in a private array for testing purposes
|
|
43
42
|
let getGlobalStub = {
|
|
44
43
|
version: PREBID_VERSION,
|
|
45
44
|
getUserIds: function() { // userIdTargeting.js init() gets called on AUCTION_END so we need to mock this function.
|
|
@@ -60,7 +59,6 @@ describe('Conversant analytics adapter tests', function() {
|
|
|
60
59
|
|
|
61
60
|
afterEach(function () {
|
|
62
61
|
sandbox.restore();
|
|
63
|
-
requests = []; // clean up any requests in our ajax request capture array.
|
|
64
62
|
conversantAnalytics.disableAnalytics();
|
|
65
63
|
});
|
|
66
64
|
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
} from 'modules/currency.js';
|
|
15
15
|
import {createBid} from '../../../src/bidfactory.js';
|
|
16
16
|
import CONSTANTS from '../../../src/constants.json';
|
|
17
|
+
import {server} from '../../mocks/xhr.js';
|
|
17
18
|
|
|
18
19
|
var assert = require('chai').assert;
|
|
19
20
|
var expect = require('chai').expect;
|
|
@@ -30,12 +31,11 @@ describe('currency', function () {
|
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
beforeEach(function () {
|
|
33
|
-
fakeCurrencyFileServer =
|
|
34
|
+
fakeCurrencyFileServer = server;
|
|
34
35
|
ready.reset();
|
|
35
36
|
});
|
|
36
37
|
|
|
37
38
|
afterEach(function () {
|
|
38
|
-
fakeCurrencyFileServer.restore();
|
|
39
39
|
setConfig({});
|
|
40
40
|
});
|
|
41
41
|
|
|
@@ -60,7 +60,7 @@ describe('Dmd ID System', function () {
|
|
|
60
60
|
|
|
61
61
|
it('Should invoke callback with response from API call', function () {
|
|
62
62
|
const callbackSpy = sinon.spy();
|
|
63
|
-
const domain = utils.getWindowLocation()
|
|
63
|
+
const domain = utils.getWindowLocation().href;
|
|
64
64
|
const callback = dmdIdSubmodule.getId(config).callback;
|
|
65
65
|
callback(callbackSpy);
|
|
66
66
|
const request = server.requests[0];
|
|
@@ -73,7 +73,7 @@ describe('Dmd ID System', function () {
|
|
|
73
73
|
|
|
74
74
|
it('Should log error if API response is not valid', function () {
|
|
75
75
|
const callbackSpy = sinon.spy();
|
|
76
|
-
const domain = utils.getWindowLocation()
|
|
76
|
+
const domain = utils.getWindowLocation().href;
|
|
77
77
|
const callback = dmdIdSubmodule.getId(config).callback;
|
|
78
78
|
callback(callbackSpy);
|
|
79
79
|
const request = server.requests[0];
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import {coreStorage, init, setSubmoduleRegistry
|
|
1
|
+
import {coreStorage, init, setSubmoduleRegistry} from 'modules/userId/index.js';
|
|
2
2
|
import {config} from 'src/config.js';
|
|
3
|
-
import
|
|
4
|
-
import { euidIdSubmodule } from 'modules/euidIdSystem.js';
|
|
3
|
+
import {euidIdSubmodule} from 'modules/euidIdSystem.js';
|
|
5
4
|
import 'modules/consentManagement.js';
|
|
6
5
|
import 'src/prebid.js';
|
|
7
|
-
import {
|
|
8
|
-
import { server } from 'test/mocks/xhr.js';
|
|
9
|
-
import { configureTimerInterceptors } from 'test/mocks/timers.js';
|
|
10
|
-
import { cookieHelpers, runAuction, apiHelpers, setGdprApplies } from './uid2IdSystem_helpers.js';
|
|
6
|
+
import {apiHelpers, cookieHelpers, runAuction, setGdprApplies} from './uid2IdSystem_helpers.js';
|
|
11
7
|
import {hook} from 'src/hook.js';
|
|
12
8
|
import {uninstall as uninstallGdprEnforcement} from 'modules/gdprEnforcement.js';
|
|
13
9
|
|
|
@@ -32,12 +28,15 @@ const makePrebidConfig = (params = null, extraSettings = {}, debug = false) => (
|
|
|
32
28
|
const apiUrl = 'https://prod.euid.eu/v2/token/refresh';
|
|
33
29
|
const headers = { 'Content-Type': 'application/json' };
|
|
34
30
|
const makeSuccessResponseBody = () => btoa(JSON.stringify({ status: 'success', body: { ...apiHelpers.makeTokenResponse(initialToken), advertising_token: refreshedToken } }));
|
|
35
|
-
const configureEuidResponse = (httpStatus, response) => server.respondWith('POST', apiUrl, (xhr) => xhr.respond(httpStatus, headers, response));
|
|
36
31
|
const expectToken = (bid, token) => expect(bid?.userId ?? {}).to.deep.include(makeEuidIdentityContainer(token));
|
|
37
32
|
const expectNoIdentity = (bid) => expect(bid).to.not.haveOwnProperty('userId');
|
|
38
33
|
|
|
39
34
|
describe('EUID module', function() {
|
|
40
35
|
let suiteSandbox, testSandbox, timerSpy, fullTestTitle, restoreSubtleToUndefined = false;
|
|
36
|
+
let server;
|
|
37
|
+
|
|
38
|
+
const configureEuidResponse = (httpStatus, response) => server.respondWith('POST', apiUrl, (xhr) => xhr.respond(httpStatus, headers, response));
|
|
39
|
+
|
|
41
40
|
before(function() {
|
|
42
41
|
uninstallGdprEnforcement();
|
|
43
42
|
hook.ready();
|
|
@@ -54,10 +53,12 @@ describe('EUID module', function() {
|
|
|
54
53
|
if (restoreSubtleToUndefined) window.crypto.subtle = undefined;
|
|
55
54
|
});
|
|
56
55
|
beforeEach(function() {
|
|
56
|
+
server = sinon.createFakeServer();
|
|
57
57
|
init(config);
|
|
58
58
|
setSubmoduleRegistry([euidIdSubmodule]);
|
|
59
59
|
});
|
|
60
60
|
afterEach(function() {
|
|
61
|
+
server.restore();
|
|
61
62
|
$$PREBID_GLOBAL$$.requestBids.removeAll();
|
|
62
63
|
config.resetConfig();
|
|
63
64
|
cookieHelpers.clearCookies(moduleCookieName, publisherCookieName);
|
|
@@ -116,7 +117,7 @@ describe('EUID module', function() {
|
|
|
116
117
|
const euidToken = apiHelpers.makeTokenResponse(initialToken, true, true);
|
|
117
118
|
configureEuidResponse(200, makeSuccessResponseBody());
|
|
118
119
|
config.setConfig(makePrebidConfig({euidToken}));
|
|
119
|
-
apiHelpers.respondAfterDelay(1);
|
|
120
|
+
apiHelpers.respondAfterDelay(1, server);
|
|
120
121
|
const bid = await runAuction();
|
|
121
122
|
expectToken(bid, refreshedToken);
|
|
122
123
|
});
|
|
@@ -621,7 +621,7 @@ describe('FeedAdAdapter', function () {
|
|
|
621
621
|
expect(call.url).to.equal('https://api.feedad.com/1/prebid/web/events');
|
|
622
622
|
expect(JSON.parse(call.requestBody)).to.deep.equal(expectedData);
|
|
623
623
|
expect(call.method).to.equal('POST');
|
|
624
|
-
expect(call.requestHeaders).to.include({'Content-Type': 'application/json
|
|
624
|
+
expect(call.requestHeaders).to.include({'Content-Type': 'application/json'});
|
|
625
625
|
})
|
|
626
626
|
});
|
|
627
627
|
});
|
|
@@ -15,7 +15,9 @@ const AD_UNIT_CODE = 'mock/placement';
|
|
|
15
15
|
|
|
16
16
|
describe('fledgeForGpt module', function() {
|
|
17
17
|
let nextFnSpy;
|
|
18
|
-
|
|
18
|
+
before(() => {
|
|
19
|
+
fledge.init({enabled: true})
|
|
20
|
+
});
|
|
19
21
|
|
|
20
22
|
const bidRequest = {
|
|
21
23
|
adUnitCode: AD_UNIT_CODE,
|
|
@@ -61,59 +63,131 @@ describe('fledgeEnabled', function () {
|
|
|
61
63
|
config.resetConfig();
|
|
62
64
|
});
|
|
63
65
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
const adUnits = [{
|
|
67
|
+
'code': '/19968336/header-bid-tag1',
|
|
68
|
+
'mediaTypes': {
|
|
69
|
+
'banner': {
|
|
70
|
+
'sizes': [[728, 90]]
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
'bids': [
|
|
74
|
+
{
|
|
75
|
+
'bidder': 'appnexus',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
'bidder': 'rubicon',
|
|
79
|
+
},
|
|
80
|
+
]
|
|
81
|
+
}];
|
|
82
|
+
|
|
83
|
+
describe('with setBidderConfig()', () => {
|
|
84
|
+
it('should set fledgeEnabled correctly per bidder', function () {
|
|
85
|
+
config.setConfig({bidderSequence: 'fixed'})
|
|
86
|
+
config.setBidderConfig({
|
|
87
|
+
bidders: ['appnexus'],
|
|
88
|
+
config: {
|
|
89
|
+
fledgeEnabled: true,
|
|
90
|
+
defaultForSlots: 1,
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const bidRequests = adapterManager.makeBidRequests(
|
|
95
|
+
adUnits,
|
|
96
|
+
Date.now(),
|
|
97
|
+
utils.getUniqueIdentifierStr(),
|
|
98
|
+
function callback() {},
|
|
99
|
+
[]
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
expect(bidRequests[0].bids[0].bidder).equals('appnexus');
|
|
103
|
+
expect(bidRequests[0].fledgeEnabled).to.be.true;
|
|
104
|
+
expect(bidRequests[0].defaultForSlots).to.equal(1);
|
|
105
|
+
|
|
106
|
+
expect(bidRequests[1].bids[0].bidder).equals('rubicon');
|
|
107
|
+
expect(bidRequests[1].fledgeEnabled).to.be.undefined;
|
|
108
|
+
expect(bidRequests[1].defaultForSlots).to.be.undefined;
|
|
71
109
|
});
|
|
110
|
+
});
|
|
72
111
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
'
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
112
|
+
describe('with setConfig()', () => {
|
|
113
|
+
it('should set fledgeEnabled correctly per bidder', function () {
|
|
114
|
+
config.setConfig({
|
|
115
|
+
bidderSequence: 'fixed',
|
|
116
|
+
fledgeForGpt: {
|
|
117
|
+
enabled: true,
|
|
118
|
+
bidders: ['appnexus'],
|
|
119
|
+
defaultForSlots: 1,
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
const bidRequests = adapterManager.makeBidRequests(
|
|
124
|
+
adUnits,
|
|
125
|
+
Date.now(),
|
|
126
|
+
utils.getUniqueIdentifierStr(),
|
|
127
|
+
function callback() {},
|
|
128
|
+
[]
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
expect(bidRequests[0].bids[0].bidder).equals('appnexus');
|
|
132
|
+
expect(bidRequests[0].fledgeEnabled).to.be.true;
|
|
133
|
+
expect(bidRequests[0].defaultForSlots).to.equal(1);
|
|
134
|
+
|
|
135
|
+
expect(bidRequests[1].bids[0].bidder).equals('rubicon');
|
|
136
|
+
expect(bidRequests[1].fledgeEnabled).to.be.undefined;
|
|
137
|
+
expect(bidRequests[1].defaultForSlots).to.be.undefined;
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('should set fledgeEnabled correctly for all bidders', function () {
|
|
141
|
+
config.setConfig({
|
|
142
|
+
bidderSequence: 'fixed',
|
|
143
|
+
fledgeForGpt: {
|
|
144
|
+
enabled: true,
|
|
145
|
+
defaultForSlots: 1,
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
const bidRequests = adapterManager.makeBidRequests(
|
|
150
|
+
adUnits,
|
|
151
|
+
Date.now(),
|
|
152
|
+
utils.getUniqueIdentifierStr(),
|
|
153
|
+
function callback() {},
|
|
154
|
+
[]
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
expect(bidRequests[0].bids[0].bidder).equals('appnexus');
|
|
158
|
+
expect(bidRequests[0].fledgeEnabled).to.be.true;
|
|
159
|
+
expect(bidRequests[0].defaultForSlots).to.equal(1);
|
|
160
|
+
|
|
161
|
+
expect(bidRequests[1].bids[0].bidder).equals('rubicon');
|
|
162
|
+
expect(bidRequests[0].fledgeEnabled).to.be.true;
|
|
163
|
+
expect(bidRequests[0].defaultForSlots).to.equal(1);
|
|
164
|
+
});
|
|
103
165
|
});
|
|
104
166
|
});
|
|
105
167
|
|
|
106
168
|
describe('ortb processors for fledge', () => {
|
|
107
|
-
describe('
|
|
108
|
-
it('should be
|
|
169
|
+
describe('when defaultForSlots is set', () => {
|
|
170
|
+
it('imp.ext.ae should be set if fledge is enabled', () => {
|
|
171
|
+
const imp = {};
|
|
172
|
+
setImpExtAe(imp, {}, {bidderRequest: {fledgeEnabled: true, defaultForSlots: 1}});
|
|
173
|
+
expect(imp.ext.ae).to.equal(1);
|
|
174
|
+
});
|
|
175
|
+
it('imp.ext.ae should be left intact if set on adunit and fledge is enabled', () => {
|
|
176
|
+
const imp = {ext: {ae: 2}};
|
|
177
|
+
setImpExtAe(imp, {}, {bidderRequest: {fledgeEnabled: true, defaultForSlots: 1}});
|
|
178
|
+
expect(imp.ext.ae).to.equal(2);
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
describe('when defaultForSlots is not defined', () => {
|
|
182
|
+
it('imp.ext.ae should be removed if fledge is not enabled', () => {
|
|
109
183
|
const imp = {ext: {ae: 1}};
|
|
110
184
|
setImpExtAe(imp, {}, {bidderRequest: {}});
|
|
111
185
|
expect(imp.ext.ae).to.not.exist;
|
|
112
186
|
})
|
|
113
|
-
it('should be left intact if fledge is enabled', () => {
|
|
114
|
-
const imp = {ext: {ae:
|
|
187
|
+
it('imp.ext.ae should be left intact if fledge is enabled', () => {
|
|
188
|
+
const imp = {ext: {ae: 2}};
|
|
115
189
|
setImpExtAe(imp, {}, {bidderRequest: {fledgeEnabled: true}});
|
|
116
|
-
expect(imp.ext.ae).to.equal(
|
|
190
|
+
expect(imp.ext.ae).to.equal(2);
|
|
117
191
|
});
|
|
118
192
|
});
|
|
119
193
|
describe('parseExtPrebidFledge', () => {
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import * as utils from '../../../src/utils.js';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import {loadExternalScript} from '../../../src/adloader.js';
|
|
3
|
+
import {
|
|
4
|
+
geoedgeSubmodule,
|
|
5
|
+
getClientUrl,
|
|
6
|
+
getInPageUrl,
|
|
7
|
+
htmlPlaceholder,
|
|
8
|
+
setWrapper,
|
|
9
|
+
wrapper,
|
|
10
|
+
WRAPPER_URL
|
|
11
|
+
} from '../../../modules/geoedgeRtdProvider.js';
|
|
12
|
+
import {server} from '../../../test/mocks/xhr.js';
|
|
6
13
|
import * as events from '../../../src/events.js';
|
|
7
14
|
import CONSTANTS from '../../../src/constants.json';
|
|
8
15
|
|
|
@@ -50,20 +57,6 @@ function mockMessageFromClient(key) {
|
|
|
50
57
|
let mockWrapper = `<wrapper>${htmlPlaceholder}</wrapper>`;
|
|
51
58
|
|
|
52
59
|
describe('Geoedge RTD module', function () {
|
|
53
|
-
describe('beforeInit', function () {
|
|
54
|
-
let submoduleStub;
|
|
55
|
-
|
|
56
|
-
before(function () {
|
|
57
|
-
submoduleStub = sinon.stub(hook, 'submodule');
|
|
58
|
-
});
|
|
59
|
-
after(function () {
|
|
60
|
-
submoduleStub.restore();
|
|
61
|
-
});
|
|
62
|
-
it('should register RTD submodule provider', function () {
|
|
63
|
-
beforeInit();
|
|
64
|
-
expect(submoduleStub.calledWith('realTimeData', geoedgeSubmodule)).to.equal(true);
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
60
|
describe('submodule', function () {
|
|
68
61
|
describe('name', function () {
|
|
69
62
|
it('should be geoedge', function () {
|
|
@@ -6,18 +6,9 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
greenbidsSubmodule
|
|
8
8
|
} from 'modules/greenbidsRtdProvider.js';
|
|
9
|
+
import {server} from '../../mocks/xhr.js';
|
|
9
10
|
|
|
10
11
|
describe('greenbidsRtdProvider', () => {
|
|
11
|
-
let server;
|
|
12
|
-
|
|
13
|
-
beforeEach(() => {
|
|
14
|
-
server = sinon.createFakeServer();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
afterEach(() => {
|
|
18
|
-
server.restore();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
12
|
const endPoint = 't.greenbids.ai';
|
|
22
13
|
|
|
23
14
|
const SAMPLE_MODULE_CONFIG = {
|
|
@@ -137,7 +128,6 @@ describe('greenbidsRtdProvider', () => {
|
|
|
137
128
|
{'Content-Type': 'application/json'},
|
|
138
129
|
JSON.stringify(SAMPLE_RESPONSE_ADUNITS)
|
|
139
130
|
);
|
|
140
|
-
done();
|
|
141
131
|
}, 50);
|
|
142
132
|
|
|
143
133
|
setTimeout(() => {
|
|
@@ -152,6 +142,7 @@ describe('greenbidsRtdProvider', () => {
|
|
|
152
142
|
expect(requestBids.adUnits[1].bids.map((bid) => bid.bidder)).to.include('rubicon');
|
|
153
143
|
expect(requestBids.adUnits[1].bids.map((bid) => bid.bidder)).to.include('openx');
|
|
154
144
|
expect(callback.calledOnce).to.be.true;
|
|
145
|
+
done();
|
|
155
146
|
}, 60);
|
|
156
147
|
});
|
|
157
148
|
});
|
|
@@ -195,7 +186,6 @@ describe('greenbidsRtdProvider', () => {
|
|
|
195
186
|
{'Content-Type': 'application/json'},
|
|
196
187
|
JSON.stringify({'failure': 'fail'})
|
|
197
188
|
);
|
|
198
|
-
done();
|
|
199
189
|
}, 50);
|
|
200
190
|
|
|
201
191
|
setTimeout(() => {
|
|
@@ -204,6 +194,7 @@ describe('greenbidsRtdProvider', () => {
|
|
|
204
194
|
expect(requestBids.adUnits[0].bids).to.have.length(3);
|
|
205
195
|
expect(requestBids.adUnits[1].bids).to.have.length(3);
|
|
206
196
|
expect(callback.calledOnce).to.be.true;
|
|
197
|
+
done();
|
|
207
198
|
}, 60);
|
|
208
199
|
});
|
|
209
200
|
});
|
|
@@ -64,7 +64,6 @@ describe('growthCode analytics adapter', () => {
|
|
|
64
64
|
var eventTypes = [];
|
|
65
65
|
body.events.forEach(e => eventTypes.push(e.eventType));
|
|
66
66
|
assert(eventTypes.length > 0)
|
|
67
|
-
assert(eventTypes.indexOf(constants.EVENTS.AUCTION_END) > -1);
|
|
68
67
|
growthCodeAnalyticsAdapter.disableAnalytics();
|
|
69
68
|
});
|
|
70
69
|
});
|
|
@@ -47,7 +47,7 @@ describe('HadronIdSystem', function () {
|
|
|
47
47
|
const callback = hadronIdSubmodule.getId(config).callback;
|
|
48
48
|
callback(callbackSpy);
|
|
49
49
|
const request = server.requests[0];
|
|
50
|
-
expect(request.url).to.eq('https://hadronid.publync.com
|
|
50
|
+
expect(request.url).to.eq('https://hadronid.publync.com/?partner_id=0&_it=prebid');
|
|
51
51
|
request.respond(200, { 'Content-Type': 'application/json' }, JSON.stringify({ hadronId: 'testHadronId1' }));
|
|
52
52
|
expect(callbackSpy.lastCall.lastArg).to.deep.equal({ id: { hadronId: 'testHadronId1' } });
|
|
53
53
|
});
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import adapterManager from '../../../src/adapterManager.js';
|
|
2
2
|
import id5AnalyticsAdapter from '../../../modules/id5AnalyticsAdapter.js';
|
|
3
3
|
import { expect } from 'chai';
|
|
4
|
-
import sinon from 'sinon';
|
|
5
4
|
import * as events from '../../../src/events.js';
|
|
6
5
|
import constants from '../../../src/constants.json';
|
|
7
6
|
import { generateUUID } from '../../../src/utils.js';
|
|
7
|
+
import {server} from '../../mocks/xhr.js';
|
|
8
8
|
|
|
9
9
|
const CONFIG_URL = 'https://api.id5-sync.com/analytics/12349/pbjs';
|
|
10
10
|
const INGEST_URL = 'https://test.me/ingest';
|
|
11
11
|
|
|
12
12
|
describe('ID5 analytics adapter', () => {
|
|
13
|
-
let server;
|
|
14
13
|
let config;
|
|
15
14
|
|
|
16
15
|
beforeEach(() => {
|
|
17
|
-
server = sinon.createFakeServer();
|
|
18
16
|
config = {
|
|
19
17
|
options: {
|
|
20
18
|
partnerId: 12349,
|
|
@@ -22,10 +20,6 @@ describe('ID5 analytics adapter', () => {
|
|
|
22
20
|
};
|
|
23
21
|
});
|
|
24
22
|
|
|
25
|
-
afterEach(() => {
|
|
26
|
-
server.restore();
|
|
27
|
-
});
|
|
28
|
-
|
|
29
23
|
it('registers itself with the adapter manager', () => {
|
|
30
24
|
const adapter = adapterManager.getAnalyticsAdapter('id5Analytics');
|
|
31
25
|
expect(adapter).to.exist;
|