prebid.js 6.24.0 → 6.26.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/33acrossBidAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtelligentBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/audiencerunBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/beopBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bluebillywigBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/cpexIdSystem.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/currency.js +1 -1
- package/dist/dfpAdServerVideo.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gravitoIdSystem.js +1 -0
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gridNMBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/impactifyBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/invibesBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/liveIntentIdSystem.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediakeysBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +123 -121
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/oneVideoBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +3 -3
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.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/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sortableBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/trustpidSystem.js +1 -1
- package/dist/trustxBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/userId.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/videoheroesBidAdapter.js +1 -0
- package/dist/vidoomyBidAdapter.js +1 -1
- package/dist/visxBidAdapter.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/zeta_global_sspBidAdapter.js +1 -1
- package/integrationExamples/gpt/userId_example.html +3 -0
- package/integrationExamples/gpt/weboramaRtdProvider_example.html +65 -11
- package/modules/.submodules.json +2 -1
- package/modules/adagioBidAdapter.js +2 -0
- package/modules/adtelligentBidAdapter.js +3 -1
- package/modules/alkimiBidAdapter.md +10 -4
- package/modules/appnexusBidAdapter.js +13 -2
- package/modules/beopBidAdapter.js +51 -6
- package/modules/cpexIdSystem.js +1 -2
- package/modules/currency.js +4 -13
- package/modules/dacIdSystem.md +4 -4
- package/modules/dfpAdServerVideo.js +8 -0
- package/modules/gravitoIdSystem.js +57 -0
- package/modules/gravitoIdSystem.md +28 -0
- package/modules/improvedigitalBidAdapter.js +100 -43
- package/modules/invibesBidAdapter.js +55 -34
- package/modules/ixBidAdapter.js +62 -26
- package/modules/ixBidAdapter.md +42 -42
- package/modules/jixieBidAdapter.js +2 -0
- package/modules/kargoBidAdapter.js +23 -8
- package/modules/oguryBidAdapter.js +27 -1
- package/modules/trustpidSystem.js +9 -28
- package/modules/trustpidSystem.md +11 -34
- package/modules/userId/eids.js +6 -0
- package/modules/userId/index.js +30 -55
- package/modules/userId/userId.md +3 -11
- package/modules/videoheroesBidAdapter.js +267 -0
- package/modules/videoheroesBidAdapter.md +134 -0
- package/modules/vidoomyBidAdapter.js +2 -6
- package/modules/weboramaRtdProvider.js +515 -241
- package/modules/weboramaRtdProvider.md +488 -51
- package/modules/zeta_global_sspBidAdapter.js +1 -1
- package/package.json +4 -4
- package/src/adserver.js +7 -0
- package/src/hook.js +19 -1
- package/src/utils/promise.js +36 -0
- package/test/spec/modules/adtelligentBidAdapter_spec.js +1 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +37 -10
- package/test/spec/modules/beopBidAdapter_spec.js +15 -2
- package/test/spec/modules/dfpAdServerVideo_spec.js +45 -0
- package/test/spec/modules/gravitoIdSystem_spec.js +51 -0
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +289 -72
- package/test/spec/modules/invibesBidAdapter_spec.js +98 -7
- package/test/spec/modules/ixBidAdapter_spec.js +132 -26
- package/test/spec/modules/jixieBidAdapter_spec.js +17 -0
- package/test/spec/modules/kargoBidAdapter_spec.js +45 -3
- package/test/spec/modules/liveIntentIdSystem_spec.js +2 -2
- package/test/spec/modules/loglyliftBidAdapter_spec.js +8 -0
- package/test/spec/modules/oguryBidAdapter_spec.js +181 -3
- package/test/spec/modules/trustpidSystem_spec.js +42 -19
- package/test/spec/modules/userId_spec.js +18 -0
- package/test/spec/modules/videoheroesBidAdapter_spec.js +363 -0
- package/test/spec/modules/weboramaRtdProvider_spec.js +2333 -266
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +37 -24
- package/test/spec/unit/utils/promise_spec.js +49 -0
- package/test/spec/modules/medianetRtdProvider_spec.js +0 -146
package/src/hook.js
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
|
-
|
|
2
1
|
import funHooks from 'fun-hooks/no-eval/index.js';
|
|
2
|
+
import {promiseControls} from './utils/promise.js';
|
|
3
3
|
|
|
4
4
|
export let hook = funHooks({
|
|
5
5
|
ready: funHooks.SYNC | funHooks.ASYNC | funHooks.QUEUE
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
+
const readyCtl = promiseControls();
|
|
9
|
+
hook.ready = (() => {
|
|
10
|
+
const ready = hook.ready;
|
|
11
|
+
return function () {
|
|
12
|
+
try {
|
|
13
|
+
return ready.apply(hook, arguments);
|
|
14
|
+
} finally {
|
|
15
|
+
readyCtl.resolve();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
})();
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A promise that resolves when hooks are ready.
|
|
22
|
+
* @type {Promise}
|
|
23
|
+
*/
|
|
24
|
+
export const ready = readyCtl.promise;
|
|
25
|
+
|
|
8
26
|
export const getHook = hook.get;
|
|
9
27
|
|
|
10
28
|
export function setupBeforeHookFnOnce(baseFn, hookFn, priority = 15) {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const SUCCESS = 0;
|
|
2
|
+
const FAIL = 1;
|
|
3
|
+
const RESULT = 2;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @returns a {promise, resolve, reject} trio where `promise` is resolved by calling `resolve` or `reject`.
|
|
7
|
+
*/
|
|
8
|
+
export function promiseControls({promiseFactory = (resolver) => new Promise(resolver)} = {}) {
|
|
9
|
+
const status = {};
|
|
10
|
+
|
|
11
|
+
function finisher(slot) {
|
|
12
|
+
return function (val) {
|
|
13
|
+
if (typeof status[slot] === 'function') {
|
|
14
|
+
status[slot](val);
|
|
15
|
+
} else if (!status[slot]) {
|
|
16
|
+
status[slot] = true;
|
|
17
|
+
status[RESULT] = val;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
promise: promiseFactory((resolve, reject) => {
|
|
24
|
+
if (status[SUCCESS] != null) {
|
|
25
|
+
resolve(status[RESULT]);
|
|
26
|
+
} else if (status[FAIL] != null) {
|
|
27
|
+
reject(status[RESULT]);
|
|
28
|
+
} else {
|
|
29
|
+
status[SUCCESS] = resolve;
|
|
30
|
+
status[FAIL] = reject;
|
|
31
|
+
}
|
|
32
|
+
}),
|
|
33
|
+
resolve: finisher(SUCCESS),
|
|
34
|
+
reject: finisher(FAIL)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -18,6 +18,7 @@ const aliasEP = {
|
|
|
18
18
|
bidsxchange: 'https://ghb.hbd.bidsxchange.com/v2/auction/',
|
|
19
19
|
streamkey: 'https://ghb.hb.streamkey.net/v2/auction/',
|
|
20
20
|
janet: 'https://ghb.bidder.jmgads.com/v2/auction/',
|
|
21
|
+
pgam: 'https://ghb.pgamssp.com/v2/auction/',
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
const DEFAULT_ADATPER_REQ = { bidderCode: 'adtelligent' };
|
|
@@ -1549,14 +1549,24 @@ describe('AppNexusAdapter', function () {
|
|
|
1549
1549
|
});
|
|
1550
1550
|
|
|
1551
1551
|
describe('transformBidParams', function () {
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1552
|
+
let gcStub;
|
|
1553
|
+
let adUnit = { bids: [{ bidder: 'appnexus' }] }; ;
|
|
1554
|
+
|
|
1555
|
+
before(function() {
|
|
1556
|
+
gcStub = sinon.stub(config, 'getConfig');
|
|
1557
|
+
});
|
|
1558
|
+
|
|
1559
|
+
after(function() {
|
|
1560
|
+
gcStub.restore();
|
|
1561
|
+
});
|
|
1562
|
+
|
|
1563
|
+
it('convert keywords param differently for psp endpoint with single s2sConfig', function () {
|
|
1564
|
+
gcStub.withArgs('s2sConfig').returns({
|
|
1565
|
+
bidders: ['appnexus'],
|
|
1566
|
+
endpoint: {
|
|
1567
|
+
p1Consent: 'https://ib.adnxs.com/openrtb2/prebid'
|
|
1568
|
+
}
|
|
1569
|
+
});
|
|
1560
1570
|
|
|
1561
1571
|
const oldParams = {
|
|
1562
1572
|
keywords: {
|
|
@@ -1565,10 +1575,27 @@ describe('AppNexusAdapter', function () {
|
|
|
1565
1575
|
}
|
|
1566
1576
|
};
|
|
1567
1577
|
|
|
1568
|
-
const newParams = spec.transformBidParams(oldParams, true);
|
|
1578
|
+
const newParams = spec.transformBidParams(oldParams, true, adUnit);
|
|
1569
1579
|
expect(newParams.keywords).to.equal('genre=rock,genre=pop,pets=dog');
|
|
1580
|
+
});
|
|
1570
1581
|
|
|
1571
|
-
|
|
1582
|
+
it('convert keywords param differently for psp endpoint with array s2sConfig', function () {
|
|
1583
|
+
gcStub.withArgs('s2sConfig').returns([{
|
|
1584
|
+
bidders: ['appnexus'],
|
|
1585
|
+
endpoint: {
|
|
1586
|
+
p1Consent: 'https://ib.adnxs.com/openrtb2/prebid'
|
|
1587
|
+
}
|
|
1588
|
+
}]);
|
|
1589
|
+
|
|
1590
|
+
const oldParams = {
|
|
1591
|
+
keywords: {
|
|
1592
|
+
genre: ['rock', 'pop'],
|
|
1593
|
+
pets: 'dog'
|
|
1594
|
+
}
|
|
1595
|
+
};
|
|
1596
|
+
|
|
1597
|
+
const newParams = spec.transformBidParams(oldParams, true, adUnit);
|
|
1598
|
+
expect(newParams.keywords).to.equal('genre=rock,genre=pop,pets=dog');
|
|
1572
1599
|
});
|
|
1573
1600
|
});
|
|
1574
1601
|
});
|
|
@@ -115,7 +115,7 @@ describe('BeOp Bid Adapter tests', () => {
|
|
|
115
115
|
},
|
|
116
116
|
'refererInfo':
|
|
117
117
|
{
|
|
118
|
-
'canonicalUrl': '
|
|
118
|
+
'canonicalUrl': 'test.te'
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
121
|
|
|
@@ -124,7 +124,20 @@ describe('BeOp Bid Adapter tests', () => {
|
|
|
124
124
|
expect(payload.tc_string).to.exist;
|
|
125
125
|
expect(payload.tc_string).to.equal('BOJ8RZsOJ8RZsABAB8AAAAAZ+A==');
|
|
126
126
|
expect(payload.url).to.exist;
|
|
127
|
-
|
|
127
|
+
// check that the protocol is added correctly
|
|
128
|
+
expect(payload.url).to.equal('http://test.te');
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
it('should not prepend the protocol in page url if already present', function () {
|
|
132
|
+
const bidderRequest = {
|
|
133
|
+
'refererInfo': {
|
|
134
|
+
'canonicalUrl': 'https://test.te'
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
138
|
+
const payload = JSON.parse(request.data);
|
|
139
|
+
expect(payload.url).to.exist;
|
|
140
|
+
expect(payload.url).to.equal('https://test.te');
|
|
128
141
|
});
|
|
129
142
|
});
|
|
130
143
|
|
|
@@ -10,6 +10,9 @@ import { auctionManager } from 'src/auctionManager.js';
|
|
|
10
10
|
import { gdprDataHandler, uspDataHandler } from 'src/adapterManager.js';
|
|
11
11
|
import * as adpod from 'modules/adpod.js';
|
|
12
12
|
import { server } from 'test/mocks/xhr.js';
|
|
13
|
+
import * as adServer from 'src/adserver.js';
|
|
14
|
+
import {deepClone} from 'src/utils.js';
|
|
15
|
+
import {hook} from '../../../src/hook.js';
|
|
13
16
|
|
|
14
17
|
const bid = {
|
|
15
18
|
videoCacheKey: 'abc',
|
|
@@ -20,6 +23,10 @@ const bid = {
|
|
|
20
23
|
};
|
|
21
24
|
|
|
22
25
|
describe('The DFP video support module', function () {
|
|
26
|
+
before(() => {
|
|
27
|
+
hook.ready();
|
|
28
|
+
});
|
|
29
|
+
|
|
23
30
|
it('should make a legal request URL when given the required params', function () {
|
|
24
31
|
const url = parse(buildDfpVideoUrl({
|
|
25
32
|
adUnit: adUnit,
|
|
@@ -226,6 +233,44 @@ describe('The DFP video support module', function () {
|
|
|
226
233
|
gdprDataHandlerStub.restore();
|
|
227
234
|
});
|
|
228
235
|
|
|
236
|
+
describe('GAM PPID', () => {
|
|
237
|
+
let ppid;
|
|
238
|
+
let getPPIDStub;
|
|
239
|
+
beforeEach(() => {
|
|
240
|
+
getPPIDStub = sinon.stub(adServer, 'getPPID').callsFake(() => ppid);
|
|
241
|
+
});
|
|
242
|
+
afterEach(() => {
|
|
243
|
+
getPPIDStub.restore();
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
Object.entries({
|
|
247
|
+
'params': {params: {'iu': 'mock/unit'}},
|
|
248
|
+
'url': {url: 'https://video.adserver.mock/', params: {'iu': 'mock/unit'}}
|
|
249
|
+
}).forEach(([t, opts]) => {
|
|
250
|
+
describe(`when using ${t}`, () => {
|
|
251
|
+
function buildUrlAndGetParams() {
|
|
252
|
+
const url = parse(buildDfpVideoUrl(Object.assign({
|
|
253
|
+
adUnit: adUnit,
|
|
254
|
+
bid: deepClone(bid),
|
|
255
|
+
}, opts)));
|
|
256
|
+
return utils.parseQS(url.query);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
it('should be included if available', () => {
|
|
260
|
+
ppid = 'mockPPID';
|
|
261
|
+
const q = buildUrlAndGetParams();
|
|
262
|
+
expect(q.ppid).to.equal('mockPPID');
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
it('should not be included if not available', () => {
|
|
266
|
+
ppid = undefined;
|
|
267
|
+
const q = buildUrlAndGetParams();
|
|
268
|
+
expect(q.hasOwnProperty('ppid')).to.be.false;
|
|
269
|
+
})
|
|
270
|
+
})
|
|
271
|
+
})
|
|
272
|
+
})
|
|
273
|
+
|
|
229
274
|
describe('special targeting unit test', function () {
|
|
230
275
|
const allTargetingData = {
|
|
231
276
|
'hb_format': 'video',
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { gravitoIdSystemSubmodule, storage, cookieKey } from 'modules/gravitoIdSystem.js';
|
|
2
|
+
|
|
3
|
+
const GRAVITOID_TEST_VALUE = 'gravitompIdTest';
|
|
4
|
+
const GRAVITOID_TEST_OBJ = {
|
|
5
|
+
gravitompId: GRAVITOID_TEST_VALUE
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
describe('gravitompId module', function () {
|
|
9
|
+
let getCookieStub;
|
|
10
|
+
|
|
11
|
+
beforeEach(function (done) {
|
|
12
|
+
getCookieStub = sinon.stub(storage, 'getCookie');
|
|
13
|
+
done();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
afterEach(function () {
|
|
17
|
+
getCookieStub.restore();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const cookieTestCasesForEmpty = [
|
|
21
|
+
undefined,
|
|
22
|
+
null,
|
|
23
|
+
''
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
describe('getId()', function () {
|
|
27
|
+
it('should return the gravitompId when it exists in cookie', function () {
|
|
28
|
+
getCookieStub.withArgs(cookieKey).returns(GRAVITOID_TEST_VALUE);
|
|
29
|
+
const id = gravitoIdSystemSubmodule.getId();
|
|
30
|
+
expect(id).to.be.deep.equal({id: {gravitompId: GRAVITOID_TEST_VALUE}});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
cookieTestCasesForEmpty.forEach(testCase => it('should return the gravitompId when it not exists in cookie', function () {
|
|
34
|
+
getCookieStub.withArgs(cookieKey).returns(testCase);
|
|
35
|
+
const id = gravitoIdSystemSubmodule.getId();
|
|
36
|
+
expect(id).to.be.deep.equal(undefined);
|
|
37
|
+
}));
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
describe('decode()', function () {
|
|
41
|
+
it('should return the gravitompId when it exists in cookie', function () {
|
|
42
|
+
const decoded = gravitoIdSystemSubmodule.decode(GRAVITOID_TEST_OBJ);
|
|
43
|
+
expect(decoded).to.be.deep.equal({gravitompId: {id: GRAVITOID_TEST_VALUE}});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('should return the undefined when decode id is not "string"', function () {
|
|
47
|
+
const decoded = gravitoIdSystemSubmodule.decode(1);
|
|
48
|
+
expect(decoded).to.equal(undefined);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
});
|