prebid.js 9.8.0 → 9.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/33acrossAnalyticsAdapter.js +1 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/BTBidAdapter.js +1 -1
- package/dist/adagioAnalyticsAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adagioUtils.js +1 -1
- package/dist/addefendBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adlooxRtdProvider.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adstirBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgAnalyticsAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/agmaAnalyticsAdapter.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/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.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/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/chunk-core.js +1 -1
- package/dist/concertBidAdapter.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/cwireBidAdapter.js +1 -1
- package/dist/dailymotionBidAdapter.js +1 -1
- package/dist/dependencies.json +10 -4
- package/dist/discoveryBidAdapter.js +1 -1
- package/dist/docereeAdManagerBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/dxkultureBidAdapter.js +1 -1
- package/dist/eclickadsBidAdapter.js +1 -0
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -1
- package/dist/exadsBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.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/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hypelabBidAdapter.js +1 -1
- package/dist/id5AnalyticsAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/imdsBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/intentIqAnalyticsAdapter.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/kimberliteBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/limelightDigitalBidAdapter.js +1 -1
- package/dist/liveIntentIdSystem.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/luceadBidAdapter.js +1 -1
- package/dist/mabidderBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediagoBidAdapter.js +1 -1
- package/dist/medianetAnalyticsAdapter.js +1 -1
- package/dist/medianetBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/missenaBidAdapter.js +1 -1
- package/dist/mobianRtdProvider.js +1 -1
- package/dist/naveggIdSystem.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/nobidAnalyticsAdapter.js +1 -1
- package/dist/nobidBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +162 -160
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxBidAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/orbidderBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/pstudioBidAdapter.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/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/richaudienceBidAdapter.js +1 -1
- package/dist/riseUtils.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/snigelBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.js +1 -1
- package/dist/tappxBidAdapter.js +1 -1
- package/dist/targetVideoAdServerVideo.js +1 -0
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/teqblazeUtils.js +1 -1
- package/dist/terceptAnalyticsAdapter.js +1 -1
- package/dist/themoneytizerBidAdapter.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/unrulyBidAdapter.js +1 -1
- package/dist/vidazooUtils.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahooAdsBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/libraries/teqblazeUtils/bidderUtils.js +1 -1
- package/modules/appnexusBidAdapter.js +1 -1
- package/modules/discoveryBidAdapter.js +1 -3
- package/modules/docereeAdManagerBidAdapter.js +14 -8
- package/modules/eclickadsBidAdapter.js +80 -0
- package/modules/eclickadsBidAdapter.md +55 -0
- package/modules/gumgumBidAdapter.js +6 -2
- package/modules/limelightDigitalBidAdapter.js +1 -1
- package/modules/mediagoBidAdapter.js +1 -3
- package/modules/mobianRtdProvider.js +12 -8
- package/modules/naveggIdSystem.js +62 -58
- package/modules/naveggIdSystem.md +8 -0
- package/modules/oguryBidAdapter.js +5 -2
- package/modules/openxBidAdapter.js +1 -6
- package/modules/pstudioBidAdapter.js +5 -8
- package/modules/pstudioBidAdapter.md +6 -4
- package/modules/richaudienceBidAdapter.js +8 -1
- package/modules/targetVideoAdServerVideo.js +96 -0
- package/modules/targetVideoAdServerVideo.md +26 -0
- package/package.json +1 -1
- package/src/adRendering.js +3 -0
- package/src/adapterManager.js +4 -0
- package/test/spec/modules/discoveryBidAdapter_spec.js +1 -47
- package/test/spec/modules/docereeAdManagerBidAdapter_spec.js +87 -9
- package/test/spec/modules/eclickadsBidAdapter_spec.js +214 -0
- package/test/spec/modules/mobianRtdProvider_spec.js +32 -15
- package/test/spec/modules/naveggIdSystem_spec.js +141 -31
- package/test/spec/modules/oguryBidAdapter_spec.js +50 -4
- package/test/spec/modules/openxBidAdapter_spec.js +15 -48
- package/test/spec/modules/pstudioBidAdapter_spec.js +5 -5
- package/test/spec/modules/richaudienceBidAdapter_spec.js +62 -0
- package/test/spec/modules/targetVideoAdServerVideo_spec.js +179 -0
- package/test/spec/unit/adRendering_spec.js +27 -1
- package/test/spec/unit/core/adapterManager_spec.js +10 -0
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from 'modules/discoveryBidAdapter.js';
|
|
11
11
|
import { getPageTitle, getPageDescription, getPageKeywords, getConnectionDownLink } from '../../../libraries/fpdUtils/pageInfo.js';
|
|
12
12
|
import * as utils from 'src/utils.js';
|
|
13
|
-
import {
|
|
13
|
+
import {getHLen} from '../../../libraries/navigatorData/navigatorData.js';
|
|
14
14
|
|
|
15
15
|
describe('discovery:BidAdapterTests', function () {
|
|
16
16
|
let sandbox;
|
|
@@ -660,51 +660,5 @@ describe('discovery Bid Adapter Tests', function () {
|
|
|
660
660
|
expect(result).be.undefined;
|
|
661
661
|
});
|
|
662
662
|
});
|
|
663
|
-
|
|
664
|
-
describe('getHC', () => {
|
|
665
|
-
it('should return the correct value of hardwareConcurrency when accessible', () => {
|
|
666
|
-
const mockWindow = {
|
|
667
|
-
top: {
|
|
668
|
-
navigator: {
|
|
669
|
-
hardwareConcurrency: 4
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
};
|
|
673
|
-
const result = getHC(mockWindow);
|
|
674
|
-
expect(result).to.equal(4);
|
|
675
|
-
});
|
|
676
|
-
it('should return undefined when accessing win.top.navigator.hardwareConcurrency throws an error', () => {
|
|
677
|
-
const mockWindow = {
|
|
678
|
-
get top() {
|
|
679
|
-
throw new Error('Access denied');
|
|
680
|
-
}
|
|
681
|
-
};
|
|
682
|
-
const result = getHC(mockWindow);
|
|
683
|
-
expect(result).be.undefined;
|
|
684
|
-
});
|
|
685
|
-
});
|
|
686
|
-
|
|
687
|
-
describe('getDM', () => {
|
|
688
|
-
it('should return the correct value of deviceMemory when accessible', () => {
|
|
689
|
-
const mockWindow = {
|
|
690
|
-
top: {
|
|
691
|
-
navigator: {
|
|
692
|
-
deviceMemory: 4
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
};
|
|
696
|
-
const result = getDM(mockWindow);
|
|
697
|
-
expect(result).to.equal(4);
|
|
698
|
-
});
|
|
699
|
-
it('should return undefined when accessing win.top.navigator.deviceMemory throws an error', () => {
|
|
700
|
-
const mockWindow = {
|
|
701
|
-
get top() {
|
|
702
|
-
throw new Error('Access denied');
|
|
703
|
-
}
|
|
704
|
-
};
|
|
705
|
-
const result = getDM(mockWindow);
|
|
706
|
-
expect(result).be.undefined;
|
|
707
|
-
});
|
|
708
|
-
});
|
|
709
663
|
});
|
|
710
664
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
|
-
import { spec } from '../../../modules/docereeAdManagerBidAdapter.js';
|
|
2
|
+
import { spec, getPayload } from '../../../modules/docereeAdManagerBidAdapter.js';
|
|
3
3
|
import { config } from '../../../src/config.js';
|
|
4
4
|
|
|
5
5
|
describe('docereeadmanager', function () {
|
|
@@ -7,25 +7,25 @@ describe('docereeadmanager', function () {
|
|
|
7
7
|
docereeadmanager: {
|
|
8
8
|
user: {
|
|
9
9
|
data: {
|
|
10
|
+
userId: '',
|
|
10
11
|
email: '',
|
|
11
12
|
firstname: '',
|
|
12
13
|
lastname: '',
|
|
13
|
-
mobile: '',
|
|
14
14
|
specialization: '',
|
|
15
|
-
organization: '',
|
|
16
15
|
hcpid: '',
|
|
17
|
-
dob: '',
|
|
18
16
|
gender: '',
|
|
19
17
|
city: '',
|
|
20
18
|
state: '',
|
|
21
|
-
|
|
19
|
+
zipcode: '',
|
|
20
|
+
hashedNPI: '',
|
|
22
21
|
hashedhcpid: '',
|
|
23
22
|
hashedemail: '',
|
|
24
23
|
hashedmobile: '',
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
platformUid: ''
|
|
24
|
+
country: '',
|
|
25
|
+
organization: '',
|
|
26
|
+
dob: '',
|
|
27
|
+
platformUid: '',
|
|
28
|
+
mobile: '',
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
},
|
|
@@ -35,6 +35,7 @@ describe('docereeadmanager', function () {
|
|
|
35
35
|
bidder: 'docereeadmanager',
|
|
36
36
|
params: {
|
|
37
37
|
placementId: 'DOC-19-1',
|
|
38
|
+
publisherUrl: 'xxxxxx.com/xxxx',
|
|
38
39
|
gdpr: '1',
|
|
39
40
|
gdprconsent:
|
|
40
41
|
'CPQfU1jPQfU1jG0AAAENAwCAAAAAAAAAAAAAAAAAAAAA.IGLtV_T9fb2vj-_Z99_tkeYwf95y3p-wzhheMs-8NyZeH_B4Wv2MyvBX4JiQKGRgksjLBAQdtHGlcTQgBwIlViTLMYk2MjzNKJrJEilsbO2dYGD9Pn8HT3ZCY70-vv__7v3ff_3g',
|
|
@@ -123,4 +124,81 @@ describe('docereeadmanager', function () {
|
|
|
123
124
|
.empty;
|
|
124
125
|
});
|
|
125
126
|
});
|
|
127
|
+
|
|
128
|
+
describe('payload', function() {
|
|
129
|
+
it('should return payload with the correct data', function() {
|
|
130
|
+
const data = {
|
|
131
|
+
userId: 'xxxxx',
|
|
132
|
+
email: 'xxxx@mail.com',
|
|
133
|
+
firstname: 'Xxxxx',
|
|
134
|
+
lastname: 'Xxxxxx',
|
|
135
|
+
specialization: 'Xxxxxxxxx',
|
|
136
|
+
hcpid: 'xxxxxxx',
|
|
137
|
+
gender: 'Xxxx',
|
|
138
|
+
city: 'Xxxxx',
|
|
139
|
+
state: 'Xxxxxx',
|
|
140
|
+
zipcode: 'XXXXXX',
|
|
141
|
+
hashedNPI: 'xxxxxx',
|
|
142
|
+
hashedhcpid: 'xxxxxxx',
|
|
143
|
+
hashedemail: 'xxxxxxx',
|
|
144
|
+
hashedmobile: 'xxxxxxx',
|
|
145
|
+
country: 'Xxxxxx',
|
|
146
|
+
organization: 'Xxxxxx',
|
|
147
|
+
dob: 'xx-xx-xxxx',
|
|
148
|
+
platformUid: 'Xx.xxx.xxxxxx',
|
|
149
|
+
mobile: 'XXXXXXXXXX',
|
|
150
|
+
}
|
|
151
|
+
bid = {...bid, params: {...bid.params, placementId: 'DOC-19-1'}}
|
|
152
|
+
const payload = getPayload(bid, data);
|
|
153
|
+
const payloadData = payload.data;
|
|
154
|
+
expect(payloadData).to.have.all.keys(
|
|
155
|
+
'userid',
|
|
156
|
+
'email',
|
|
157
|
+
'firstname',
|
|
158
|
+
'lastname',
|
|
159
|
+
'specialization',
|
|
160
|
+
'hcpid',
|
|
161
|
+
'gender',
|
|
162
|
+
'city',
|
|
163
|
+
'state',
|
|
164
|
+
'zipcode',
|
|
165
|
+
'hashedNPI',
|
|
166
|
+
'pb',
|
|
167
|
+
'adunit',
|
|
168
|
+
'requestId',
|
|
169
|
+
'hashedhcpid',
|
|
170
|
+
'hashedemail',
|
|
171
|
+
'hashedmobile',
|
|
172
|
+
'country',
|
|
173
|
+
'organization',
|
|
174
|
+
'dob',
|
|
175
|
+
'userconsent',
|
|
176
|
+
'mobile',
|
|
177
|
+
'pageurl'
|
|
178
|
+
);
|
|
179
|
+
expect(payloadData.userid).to.equal('Xx.xxx.xxxxxx');
|
|
180
|
+
expect(payloadData.email).to.equal('xxxx@mail.com');
|
|
181
|
+
expect(payloadData.firstname).to.equal('Xxxxx');
|
|
182
|
+
expect(payloadData.lastname).to.equal('Xxxxxx');
|
|
183
|
+
expect(payloadData.specialization).to.equal('Xxxxxxxxx');
|
|
184
|
+
expect(payloadData.hcpid).to.equal('xxxxxxx');
|
|
185
|
+
expect(payloadData.gender).to.equal('Xxxx');
|
|
186
|
+
expect(payloadData.city).to.equal('Xxxxx');
|
|
187
|
+
expect(payloadData.state).to.equal('Xxxxxx');
|
|
188
|
+
expect(payloadData.zipcode).to.equal('XXXXXX');
|
|
189
|
+
expect(payloadData.hashedNPI).to.equal('xxxxxx');
|
|
190
|
+
expect(payloadData.pb).to.equal(1);
|
|
191
|
+
expect(payloadData.userconsent).to.equal(1);
|
|
192
|
+
expect(payloadData.dob).to.equal('xx-xx-xxxx');
|
|
193
|
+
expect(payloadData.organization).to.equal('Xxxxxx');
|
|
194
|
+
expect(payloadData.country).to.equal('Xxxxxx');
|
|
195
|
+
expect(payloadData.hashedmobile).to.equal('xxxxxxx');
|
|
196
|
+
expect(payloadData.hashedemail).to.equal('xxxxxxx');
|
|
197
|
+
expect(payloadData.hashedhcpid).to.equal('xxxxxxx');
|
|
198
|
+
expect(payloadData.requestId).to.equal('testing');
|
|
199
|
+
expect(payloadData.mobile).to.equal('XXXXXXXXXX');
|
|
200
|
+
expect(payloadData.adunit).to.equal('DOC-19-1');
|
|
201
|
+
expect(payloadData.pageurl).to.equal('xxxxxx.com/xxxx');
|
|
202
|
+
})
|
|
203
|
+
})
|
|
126
204
|
});
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import {
|
|
3
|
+
spec,
|
|
4
|
+
ENDPOINT,
|
|
5
|
+
BIDDER_CODE,
|
|
6
|
+
} from '../../../modules/eclickadsBidAdapter.js';
|
|
7
|
+
import { NATIVE, BANNER, VIDEO } from '../../../src/mediaTypes.js';
|
|
8
|
+
import { deepClone } from '../../../src/utils.js';
|
|
9
|
+
import { config } from '../../../src/config.js';
|
|
10
|
+
|
|
11
|
+
describe('eclickadsBidAdapter', () => {
|
|
12
|
+
const bidItem = {
|
|
13
|
+
bidder: BIDDER_CODE,
|
|
14
|
+
params: {
|
|
15
|
+
zid: '7096',
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
const eclickadsBidderConfigData = {
|
|
19
|
+
orig_aid: 'xqf7zdmg7the65ac.1718271138.des',
|
|
20
|
+
fosp_aid: '1013000403',
|
|
21
|
+
fosp_uid: '7aab24a4663258a2c1d76a08b20f7e6e',
|
|
22
|
+
id: '84b2a41c4299bb9b8924423e',
|
|
23
|
+
myvne_id: '1013000403',
|
|
24
|
+
};
|
|
25
|
+
const bidRequest = {
|
|
26
|
+
code: 'test-div',
|
|
27
|
+
size: [[320, 85]],
|
|
28
|
+
mediaTypes: {
|
|
29
|
+
[NATIVE]: {
|
|
30
|
+
title: {
|
|
31
|
+
required: true,
|
|
32
|
+
},
|
|
33
|
+
body: {
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
image: {
|
|
37
|
+
required: true,
|
|
38
|
+
},
|
|
39
|
+
sponsoredBy: {
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
icon: {
|
|
43
|
+
required: false,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
ortb2: {
|
|
48
|
+
device: {
|
|
49
|
+
w: 980,
|
|
50
|
+
h: 1720,
|
|
51
|
+
dnt: 0,
|
|
52
|
+
ua: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/125.0.6422.80 Mobile/15E148 Safari/604.1',
|
|
53
|
+
language: 'en',
|
|
54
|
+
devicetype: 1,
|
|
55
|
+
make: 'Apple',
|
|
56
|
+
model: 'iPhone 12 Pro Max',
|
|
57
|
+
os: 'iOS',
|
|
58
|
+
osv: '17.4',
|
|
59
|
+
},
|
|
60
|
+
site: {
|
|
61
|
+
name: 'example',
|
|
62
|
+
domain: 'page.example.com',
|
|
63
|
+
page: 'https://page.example.com/here.html',
|
|
64
|
+
ref: 'https://ref.example.com',
|
|
65
|
+
ext: {
|
|
66
|
+
data: eclickadsBidderConfigData,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
describe('isBidRequestValid', () => {
|
|
73
|
+
it('should return false when atleast one of required params is missing', () => {
|
|
74
|
+
const bid = deepClone(bidItem);
|
|
75
|
+
delete bid.params.zid;
|
|
76
|
+
expect(spec.isBidRequestValid(bid)).to.be.false;
|
|
77
|
+
});
|
|
78
|
+
it('should return true if there is correct required params and mediatype', () => {
|
|
79
|
+
bidItem.params.mediaTypes == NATIVE;
|
|
80
|
+
expect(spec.isBidRequestValid(bidItem)).to.be.true;
|
|
81
|
+
});
|
|
82
|
+
it('should return true if there is no size', () => {
|
|
83
|
+
const bid = deepClone(bidItem);
|
|
84
|
+
delete bid.params.size;
|
|
85
|
+
expect(spec.isBidRequestValid(bid)).to.be.true;
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
describe('buildRequests', () => {
|
|
90
|
+
const bidList = [bidItem];
|
|
91
|
+
const request = config.runWithBidder(BIDDER_CODE, () =>
|
|
92
|
+
spec.buildRequests(bidList, bidRequest)
|
|
93
|
+
);
|
|
94
|
+
const _data = request.data;
|
|
95
|
+
|
|
96
|
+
it('should be create a request to server with POST method, data, valid url', () => {
|
|
97
|
+
expect(request).to.be.exist;
|
|
98
|
+
expect(_data).to.be.exist;
|
|
99
|
+
expect(request.method).to.be.exist;
|
|
100
|
+
expect(request.method).equal('POST');
|
|
101
|
+
expect(request.url).to.be.exist;
|
|
102
|
+
expect(request.url).equal(ENDPOINT + eclickadsBidderConfigData.fosp_uid);
|
|
103
|
+
});
|
|
104
|
+
it('should return valid data format if bid array is valid', () => {
|
|
105
|
+
expect(_data).to.be.an('object');
|
|
106
|
+
expect(_data).to.has.all.keys(
|
|
107
|
+
'deviceWidth',
|
|
108
|
+
'deviceHeight',
|
|
109
|
+
'language',
|
|
110
|
+
'host',
|
|
111
|
+
'ua',
|
|
112
|
+
'page',
|
|
113
|
+
'imp',
|
|
114
|
+
'device',
|
|
115
|
+
'myvne_id',
|
|
116
|
+
'orig_aid',
|
|
117
|
+
'fosp_aid',
|
|
118
|
+
'fosp_uid',
|
|
119
|
+
'id'
|
|
120
|
+
);
|
|
121
|
+
expect(_data.deviceWidth).to.be.an('number');
|
|
122
|
+
expect(_data.deviceHeight).to.be.an('number');
|
|
123
|
+
expect(_data.device).to.be.an('string');
|
|
124
|
+
expect(_data.language).to.be.an('string');
|
|
125
|
+
expect(_data.host).to.be.an('string').that.is.equal('page.example.com');
|
|
126
|
+
expect(_data.page)
|
|
127
|
+
.to.be.an('string')
|
|
128
|
+
.that.is.equal('https://page.example.com/here.html');
|
|
129
|
+
expect(_data.imp).to.be.an('array');
|
|
130
|
+
expect(_data.myvne_id).to.be.an('string');
|
|
131
|
+
expect(_data.orig_aid).to.be.an('string');
|
|
132
|
+
expect(_data.fosp_aid).to.be.an('string');
|
|
133
|
+
expect(_data.myvne_id).to.be.an('string');
|
|
134
|
+
expect(_data.fosp_uid).to.be.an('string');
|
|
135
|
+
expect(_data.id).to.be.an('string');
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('should return empty array if there is no bidItem passed', () => {
|
|
139
|
+
const request = config.runWithBidder(BIDDER_CODE, () =>
|
|
140
|
+
spec.buildRequests([], bidRequest)
|
|
141
|
+
);
|
|
142
|
+
const _data = request.data;
|
|
143
|
+
expect(_data.imp).to.be.an('array').that.is.empty;
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('should return the number of imp equal to the number of bidItem', () => {
|
|
147
|
+
expect(_data.imp).to.have.lengthOf(bidList.length);
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
it('have to contain required params and correct format for sending to EClickAds', () => {
|
|
151
|
+
const item = _data.imp[0];
|
|
152
|
+
expect(item.zid).to.be.an('string');
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
describe('interpretResponse', () => {
|
|
157
|
+
const expectedResponse = {
|
|
158
|
+
id: '84b2a41c4299bb9b8924423e',
|
|
159
|
+
seat: '35809',
|
|
160
|
+
seatbid: [
|
|
161
|
+
{
|
|
162
|
+
id: 'DBCCDFD5-AACC-424E-8225-4160D35CBE5D',
|
|
163
|
+
impid: '35ea1073c745d6c',
|
|
164
|
+
adUnitCode: '8871826dc92e',
|
|
165
|
+
requestId: '1122839202z3v',
|
|
166
|
+
creativeId: '112233ss921v',
|
|
167
|
+
netRevenue: true,
|
|
168
|
+
currency: ['VND'],
|
|
169
|
+
cpm: 0.1844,
|
|
170
|
+
ad: 'eclickads_ad_p',
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
const response = spec.interpretResponse({ body: expectedResponse });
|
|
176
|
+
|
|
177
|
+
it('should return an array of offers', () => {
|
|
178
|
+
expect(response).to.be.an('array');
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it('should return empty array if there is no offer from server response', () => {
|
|
182
|
+
const emptyOfferResponse = deepClone(expectedResponse);
|
|
183
|
+
emptyOfferResponse.seatbid = [];
|
|
184
|
+
const response = spec.interpretResponse({ body: emptyOfferResponse });
|
|
185
|
+
expect(response).to.be.an('array').that.is.empty;
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
it('should return empty array if seatbid from server response is null or missing', () => {
|
|
189
|
+
const nullOfferResponse = deepClone(expectedResponse);
|
|
190
|
+
nullOfferResponse.seatbid = null;
|
|
191
|
+
const response = spec.interpretResponse({ body: nullOfferResponse });
|
|
192
|
+
expect(response).to.be.an('array').that.is.empty;
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
it('should return empty array if server response is get error - empty', () => {
|
|
196
|
+
const response = spec.interpretResponse({ body: undefined });
|
|
197
|
+
expect(response).to.be.an('array').that.is.empty;
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
it('should return correct format, params for each of offers from server response', () => {
|
|
201
|
+
const offer = response[0];
|
|
202
|
+
expect(offer.id).to.be.an('string').that.is.not.empty;
|
|
203
|
+
expect(offer.impid).to.be.an('string').that.is.not.empty;
|
|
204
|
+
expect(offer.requestId).to.be.an('string').that.is.not.empty;
|
|
205
|
+
expect(offer.creativeId).to.be.an('string').that.is.not.empty;
|
|
206
|
+
expect(offer.netRevenue).to.be.an('boolean');
|
|
207
|
+
expect(offer.ttl).to.be.an('number');
|
|
208
|
+
expect(offer.cpm).to.be.an('number').greaterThan(0);
|
|
209
|
+
expect(offer.adserverTargeting).to.be.an('object');
|
|
210
|
+
expect(offer.adserverTargeting['hb_ad_eclickads']).to.be.an('string').that
|
|
211
|
+
.is.not.empty;
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
});
|
|
@@ -12,7 +12,9 @@ describe('Mobian RTD Submodule', function () {
|
|
|
12
12
|
ortb2Fragments: {
|
|
13
13
|
global: {
|
|
14
14
|
site: {
|
|
15
|
-
ext: {
|
|
15
|
+
ext: {
|
|
16
|
+
data: {}
|
|
17
|
+
}
|
|
16
18
|
}
|
|
17
19
|
}
|
|
18
20
|
}
|
|
@@ -23,7 +25,7 @@ describe('Mobian RTD Submodule', function () {
|
|
|
23
25
|
ajaxStub.restore();
|
|
24
26
|
});
|
|
25
27
|
|
|
26
|
-
it('should
|
|
28
|
+
it('should set key-value pairs when server responds with garm_risk', function () {
|
|
27
29
|
ajaxStub = sinon.stub(ajax, 'ajaxBuilder').returns(function(url, callbacks) {
|
|
28
30
|
callbacks.success(JSON.stringify({
|
|
29
31
|
garm_risk: 'low',
|
|
@@ -32,14 +34,19 @@ describe('Mobian RTD Submodule', function () {
|
|
|
32
34
|
}));
|
|
33
35
|
});
|
|
34
36
|
|
|
35
|
-
return mobianBrandSafetySubmodule.getBidRequestData(bidReqConfig, {}, {}).then((
|
|
36
|
-
expect(
|
|
37
|
+
return mobianBrandSafetySubmodule.getBidRequestData(bidReqConfig, {}, {}).then((result) => {
|
|
38
|
+
expect(result).to.deep.equal({
|
|
37
39
|
risk: 'low',
|
|
38
40
|
contentCategories: [],
|
|
39
41
|
sentiment: 'positive',
|
|
40
42
|
emotions: ['joy']
|
|
41
43
|
});
|
|
42
|
-
expect(bidReqConfig.ortb2Fragments.global.site.ext.data
|
|
44
|
+
expect(bidReqConfig.ortb2Fragments.global.site.ext.data).to.deep.include({
|
|
45
|
+
mobianRisk: 'low',
|
|
46
|
+
mobianContentCategories: [],
|
|
47
|
+
mobianSentiment: 'positive',
|
|
48
|
+
mobianEmotions: ['joy']
|
|
49
|
+
});
|
|
43
50
|
});
|
|
44
51
|
});
|
|
45
52
|
|
|
@@ -55,14 +62,19 @@ describe('Mobian RTD Submodule', function () {
|
|
|
55
62
|
}));
|
|
56
63
|
});
|
|
57
64
|
|
|
58
|
-
return mobianBrandSafetySubmodule.getBidRequestData(bidReqConfig, {}, {}).then((
|
|
59
|
-
expect(
|
|
65
|
+
return mobianBrandSafetySubmodule.getBidRequestData(bidReqConfig, {}, {}).then((result) => {
|
|
66
|
+
expect(result).to.deep.equal({
|
|
60
67
|
risk: 'medium',
|
|
61
68
|
contentCategories: ['arms', 'crime'],
|
|
62
69
|
sentiment: 'negative',
|
|
63
70
|
emotions: ['anger', 'fear']
|
|
64
71
|
});
|
|
65
|
-
expect(bidReqConfig.ortb2Fragments.global.site.ext.data
|
|
72
|
+
expect(bidReqConfig.ortb2Fragments.global.site.ext.data).to.deep.include({
|
|
73
|
+
mobianRisk: 'medium',
|
|
74
|
+
mobianContentCategories: ['arms', 'crime'],
|
|
75
|
+
mobianSentiment: 'negative',
|
|
76
|
+
mobianEmotions: ['anger', 'fear']
|
|
77
|
+
});
|
|
66
78
|
});
|
|
67
79
|
});
|
|
68
80
|
|
|
@@ -73,14 +85,19 @@ describe('Mobian RTD Submodule', function () {
|
|
|
73
85
|
}));
|
|
74
86
|
});
|
|
75
87
|
|
|
76
|
-
return mobianBrandSafetySubmodule.getBidRequestData(bidReqConfig, {}, {}).then((
|
|
77
|
-
expect(
|
|
88
|
+
return mobianBrandSafetySubmodule.getBidRequestData(bidReqConfig, {}, {}).then((result) => {
|
|
89
|
+
expect(result).to.deep.equal({
|
|
78
90
|
risk: 'unknown',
|
|
79
91
|
contentCategories: [],
|
|
80
92
|
sentiment: 'neutral',
|
|
81
93
|
emotions: []
|
|
82
94
|
});
|
|
83
|
-
expect(bidReqConfig.ortb2Fragments.global.site.ext.data
|
|
95
|
+
expect(bidReqConfig.ortb2Fragments.global.site.ext.data).to.deep.include({
|
|
96
|
+
mobianRisk: 'unknown',
|
|
97
|
+
mobianContentCategories: [],
|
|
98
|
+
mobianSentiment: 'neutral',
|
|
99
|
+
mobianEmotions: []
|
|
100
|
+
});
|
|
84
101
|
});
|
|
85
102
|
});
|
|
86
103
|
|
|
@@ -89,8 +106,8 @@ describe('Mobian RTD Submodule', function () {
|
|
|
89
106
|
callbacks.success('unexpected output not even of the right type');
|
|
90
107
|
});
|
|
91
108
|
const originalConfig = JSON.parse(JSON.stringify(bidReqConfig));
|
|
92
|
-
return mobianBrandSafetySubmodule.getBidRequestData(bidReqConfig, {}, {}).then((
|
|
93
|
-
expect(
|
|
109
|
+
return mobianBrandSafetySubmodule.getBidRequestData(bidReqConfig, {}, {}).then((result) => {
|
|
110
|
+
expect(result).to.deep.equal({});
|
|
94
111
|
// Check that bidReqConfig hasn't been modified
|
|
95
112
|
expect(bidReqConfig).to.deep.equal(originalConfig);
|
|
96
113
|
});
|
|
@@ -101,8 +118,8 @@ describe('Mobian RTD Submodule', function () {
|
|
|
101
118
|
callbacks.error();
|
|
102
119
|
});
|
|
103
120
|
|
|
104
|
-
return mobianBrandSafetySubmodule.getBidRequestData(bidReqConfig, {}, {}).then((
|
|
105
|
-
expect(
|
|
121
|
+
return mobianBrandSafetySubmodule.getBidRequestData(bidReqConfig, {}, {}).then((result) => {
|
|
122
|
+
expect(result).to.deep.equal({});
|
|
106
123
|
});
|
|
107
124
|
});
|
|
108
125
|
});
|