prebid.js 7.48.0 → 7.49.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/README.md +3 -0
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/admixerBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/aidemBidAdapter.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/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.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/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/glimpseBidAdapter.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/id5IdSystem.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.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/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.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/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +129 -128
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.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 +1 -1
- package/dist/prebidServerBidAdapter.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/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 -0
- 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/shinezBidAdapter.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/sovrnAnalyticsAdapter.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/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/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/vidazooBidAdapter.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/yahoosspBidAdapter.js +1 -1
- package/dist/yieldlabBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/modules/adgenerationBidAdapter.js +24 -15
- package/modules/admixerBidAdapter.js +15 -9
- package/modules/aidemBidAdapter.js +3 -1
- package/modules/ixBidAdapter.js +65 -47
- package/modules/kueezRtbBidAdapter.js +30 -33
- package/modules/mgidBidAdapter.js +9 -8
- package/modules/minutemediaBidAdapter.js +6 -0
- package/modules/minutemediaplusBidAdapter.js +30 -32
- package/modules/nexx360BidAdapter.js +2 -1
- package/modules/prebidServerBidAdapter/index.js +1 -3
- package/modules/prebidServerBidAdapter/ortbConverter.js +5 -1
- package/modules/pubmaticAnalyticsAdapter.js +3 -2
- package/modules/retailspotBidAdapter .md +32 -0
- package/modules/retailspotBidAdapter.js +186 -0
- package/modules/riseBidAdapter.js +6 -0
- package/modules/ttdBidAdapter.js +23 -22
- package/modules/vidazooBidAdapter.js +28 -32
- package/modules/yieldlabBidAdapter.js +27 -5
- package/package.json +1 -1
- package/src/adapterManager.js +4 -0
- package/src/adapters/bidderFactory.js +1 -0
- package/src/auction.js +2 -0
- package/src/prebid.js +36 -12
- package/src/utils/cpm.js +4 -1
- package/test/spec/modules/adgenerationBidAdapter_spec.js +6 -6
- package/test/spec/modules/admixerBidAdapter_spec.js +64 -25
- package/test/spec/modules/aidemBidAdapter_spec.js +3 -0
- package/test/spec/modules/ixBidAdapter_spec.js +66 -1
- package/test/spec/modules/kueezRtbBidAdapter_spec.js +3 -2
- package/test/spec/modules/mgidBidAdapter_spec.js +9 -9
- package/test/spec/modules/minutemediaBidAdapter_spec.js +18 -0
- package/test/spec/modules/minutemediaplusBidAdapter_spec.js +3 -2
- package/test/spec/modules/prebidServerBidAdapter_spec.js +96 -1
- package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +6 -1
- package/test/spec/modules/retailspotBidAdapter_spec.js +426 -0
- package/test/spec/modules/riseBidAdapter_spec.js +18 -0
- package/test/spec/modules/ttdBidAdapter_spec.js +129 -2
- package/test/spec/modules/vidazooBidAdapter_spec.js +3 -2
- package/test/spec/modules/yieldlabBidAdapter_spec.js +8 -1
- package/test/spec/unit/core/bidderFactory_spec.js +9 -9
- package/test/spec/unit/pbjs_api_spec.js +59 -1
- package/test/spec/unit/utils/cpm_spec.js +56 -1
|
@@ -371,7 +371,8 @@ describe('pubmatic analytics adapter', function () {
|
|
|
371
371
|
expect(data.s[0].fskp).to.equal(0);
|
|
372
372
|
expect(data.s[0].sz).to.deep.equal(['640x480']);
|
|
373
373
|
expect(data.s[0].ps).to.be.an('array');
|
|
374
|
-
|
|
374
|
+
expect(data.s[0].au).to.equal('/19968336/header-bid-tag-0');
|
|
375
|
+
expect(data.s[0].ps.length).to.equal(1);
|
|
375
376
|
expect(data.s[0].ps[0].pn).to.equal('pubmatic');
|
|
376
377
|
expect(data.s[0].ps[0].bc).to.equal('pubmatic');
|
|
377
378
|
expect(data.s[0].ps[0].bidid).to.equal('2ecff0db240757');
|
|
@@ -481,6 +482,7 @@ describe('pubmatic analytics adapter', function () {
|
|
|
481
482
|
expect(data.s[0].fskp).to.equal(0);
|
|
482
483
|
expect(data.s[0].sz).to.deep.equal(['640x480']);
|
|
483
484
|
expect(data.s[0].ps).to.be.an('array');
|
|
485
|
+
expect(data.s[0].au).to.equal('/19968336/header-bid-tag-0');
|
|
484
486
|
expect(data.s[0].ps.length).to.equal(1);
|
|
485
487
|
expect(data.s[0].ps[0].pn).to.equal('pubmatic');
|
|
486
488
|
expect(data.s[0].ps[0].bc).to.equal('pubmatic');
|
|
@@ -553,6 +555,7 @@ describe('pubmatic analytics adapter', function () {
|
|
|
553
555
|
expect(data.s[0].sz).to.deep.equal(['640x480']);
|
|
554
556
|
expect(data.s[0].ps).to.be.an('array');
|
|
555
557
|
expect(data.s[0].ps.length).to.equal(1);
|
|
558
|
+
expect(data.s[0].au).to.equal('/19968336/header-bid-tag-0');
|
|
556
559
|
expect(data.s[0].ps[0].pn).to.equal('pubmatic');
|
|
557
560
|
expect(data.s[0].ps[0].bc).to.equal('pubmatic');
|
|
558
561
|
expect(data.s[0].ps[0].bidid).to.equal('2ecff0db240757');
|
|
@@ -1029,6 +1032,7 @@ describe('pubmatic analytics adapter', function () {
|
|
|
1029
1032
|
expect(data.s[0].fskp).to.equal(0);
|
|
1030
1033
|
expect(data.s[0].sz).to.deep.equal(['640x480']);
|
|
1031
1034
|
expect(data.s[0].ps).to.be.an('array');
|
|
1035
|
+
expect(data.s[0].au).to.equal('/19968336/header-bid-tag-0');
|
|
1032
1036
|
expect(data.s[0].ps.length).to.equal(1);
|
|
1033
1037
|
expect(data.s[0].ps[0].pn).to.equal('pubmatic');
|
|
1034
1038
|
expect(data.s[0].ps[0].bc).to.equal('pubmatic_alias');
|
|
@@ -1147,6 +1151,7 @@ describe('pubmatic analytics adapter', function () {
|
|
|
1147
1151
|
expect(data.s[0].fskp).to.equal(0);
|
|
1148
1152
|
expect(data.s[0].sz).to.deep.equal(['640x480']);
|
|
1149
1153
|
expect(data.s[0].ps).to.be.an('array');
|
|
1154
|
+
expect(data.s[0].au).to.equal('/19968336/header-bid-tag-0');
|
|
1150
1155
|
expect(data.s[0].ps.length).to.equal(1);
|
|
1151
1156
|
expect(data.s[0].ps[0].pn).to.equal('pubmatic');
|
|
1152
1157
|
expect(data.s[0].ps[0].bc).to.equal('groupm');
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
|
|
3
|
+
import { spec } from 'modules/retailspotBidAdapter.js';
|
|
4
|
+
import { newBidder } from 'src/adapters/bidderFactory.js';
|
|
5
|
+
|
|
6
|
+
describe('RetailSpot Adapter', function () {
|
|
7
|
+
const canonicalUrl = 'https://canonical.url/?t=%26';
|
|
8
|
+
const referrerUrl = 'http://referrer.url/?param=value';
|
|
9
|
+
const pageUrl = 'http://page.url/?param=value';
|
|
10
|
+
const domain = 'domain:123';
|
|
11
|
+
const env = 'preprod';
|
|
12
|
+
const consentString = 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A==';
|
|
13
|
+
const bidderRequest = {
|
|
14
|
+
'auctionId': '1d1a030790a475',
|
|
15
|
+
'bidderRequestId': '22edbae2733bf6',
|
|
16
|
+
'timeout': 3000,
|
|
17
|
+
'gdprConsent': {
|
|
18
|
+
consentString: consentString,
|
|
19
|
+
gdprApplies: true
|
|
20
|
+
},
|
|
21
|
+
refererInfo: {location: referrerUrl, canonicalUrl, domain, topmostLocation: 'fakePageURL'},
|
|
22
|
+
ortb2: {site: {page: pageUrl, ref: referrerUrl}}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const bidRequestWithSinglePlacement = [
|
|
26
|
+
{
|
|
27
|
+
'bidId': 'bid_id_0',
|
|
28
|
+
'bidder': 'retailspot',
|
|
29
|
+
'placementCode': 'adunit/hb-0',
|
|
30
|
+
'params': {
|
|
31
|
+
'placement': 'placement_0'
|
|
32
|
+
},
|
|
33
|
+
'sizes': '300x250',
|
|
34
|
+
'mediaTypes': {
|
|
35
|
+
'banner': {
|
|
36
|
+
'sizes': ['300x250']
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
'transactionId': 'bid_id_0_transaction_id'
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
const bidRequestWithMultipleMediatype = [
|
|
44
|
+
{
|
|
45
|
+
'bidId': 'bid_id_0',
|
|
46
|
+
'bidder': 'retailspot',
|
|
47
|
+
'placementCode': 'adunit/hb-0',
|
|
48
|
+
'params': {
|
|
49
|
+
'placement': 'placement_0'
|
|
50
|
+
},
|
|
51
|
+
'sizes': '300x250',
|
|
52
|
+
'mediaTypes': {
|
|
53
|
+
'banner': {
|
|
54
|
+
'sizes': ['640x480']
|
|
55
|
+
},
|
|
56
|
+
'video': {
|
|
57
|
+
'playerSize': [640, 480],
|
|
58
|
+
'context': 'outstream'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
'transactionId': 'bid_id_0_transaction_id'
|
|
62
|
+
}
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
const sentBidVideo = [
|
|
66
|
+
{
|
|
67
|
+
'bidId': 'bid_id_0',
|
|
68
|
+
'placement': 'test-1234',
|
|
69
|
+
'video': {
|
|
70
|
+
'playerSize': [640, 480]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
];
|
|
74
|
+
|
|
75
|
+
const bidRequestWithDevPlacement = [
|
|
76
|
+
{
|
|
77
|
+
'bidId': 'bid_id_0',
|
|
78
|
+
'bidder': 'retailspot',
|
|
79
|
+
'placementCode': 'adunit/hb-0',
|
|
80
|
+
'params': {
|
|
81
|
+
'placement': 'placement_0',
|
|
82
|
+
'env': 'dev'
|
|
83
|
+
},
|
|
84
|
+
'sizes': '300x250',
|
|
85
|
+
'mediaTypes':
|
|
86
|
+
{ 'banner':
|
|
87
|
+
{'sizes': ['300x250']
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
'transactionId': 'bid_id_0_transaction_id'
|
|
91
|
+
}
|
|
92
|
+
];
|
|
93
|
+
|
|
94
|
+
const bidRequestMultiPlacements = [
|
|
95
|
+
{
|
|
96
|
+
'bidId': 'bid_id_0',
|
|
97
|
+
'bidder': 'retailspot',
|
|
98
|
+
'placementCode': 'adunit/hb-0',
|
|
99
|
+
'params': {
|
|
100
|
+
'placement': 'placement_0'
|
|
101
|
+
},
|
|
102
|
+
'sizes': '300x250',
|
|
103
|
+
'mediaTypes':
|
|
104
|
+
{ 'banner':
|
|
105
|
+
{'sizes': ['300x250']
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
'transactionId': 'bid_id_0_transaction_id'
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
'bidId': 'bid_id_1',
|
|
112
|
+
'bidder': 'retailspot',
|
|
113
|
+
'placementCode': 'adunit/hb-1',
|
|
114
|
+
'params': {
|
|
115
|
+
'placement': 'placement_1'
|
|
116
|
+
},
|
|
117
|
+
'sizes': [[300, 600]],
|
|
118
|
+
'mediaTypes':
|
|
119
|
+
{ 'banner':
|
|
120
|
+
{'sizes': ['300x600']
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
'transactionId': 'bid_id_1_transaction_id'
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
'bidId': 'bid_id_2',
|
|
127
|
+
'bidder': 'retailspot',
|
|
128
|
+
'placementCode': 'adunit/hb-2',
|
|
129
|
+
'params': {},
|
|
130
|
+
'sizes': '300x400',
|
|
131
|
+
'transactionId': 'bid_id_2_transaction_id'
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
'bidId': 'bid_id_3',
|
|
135
|
+
'bidder': 'retailspot',
|
|
136
|
+
'placementCode': 'adunit/hb-3',
|
|
137
|
+
'params': {
|
|
138
|
+
'placement': 'placement_3'
|
|
139
|
+
},
|
|
140
|
+
'transactionId': 'bid_id_3_transaction_id'
|
|
141
|
+
}
|
|
142
|
+
];
|
|
143
|
+
|
|
144
|
+
const requestDataOnePlacement = [
|
|
145
|
+
{
|
|
146
|
+
'bidId': 'bid_id_0',
|
|
147
|
+
'placement': 'e622af275681965d3095808561a1e510',
|
|
148
|
+
'width': 300,
|
|
149
|
+
'height': 600
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
|
|
153
|
+
const requestDataMultiPlacement = [
|
|
154
|
+
{
|
|
155
|
+
'bidId': 'bid_id_0',
|
|
156
|
+
'placement': 'e622af275681965d3095808561a1e510',
|
|
157
|
+
'width': 300,
|
|
158
|
+
'height': 600
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
'bidId': 'bid_id_1',
|
|
162
|
+
'placement': 'e622af275681965d3095808561a1e510',
|
|
163
|
+
'width': 400,
|
|
164
|
+
'height': 250
|
|
165
|
+
}
|
|
166
|
+
]
|
|
167
|
+
|
|
168
|
+
const testMetaObject = {
|
|
169
|
+
'networkId': 123,
|
|
170
|
+
'advertiserId': '3',
|
|
171
|
+
'advertiserName': 'foobar',
|
|
172
|
+
'advertiserDomains': ['foobar.com'],
|
|
173
|
+
'brandId': '345',
|
|
174
|
+
'brandName': 'Foo',
|
|
175
|
+
'primaryCatId': '34',
|
|
176
|
+
'secondaryCatIds': ['IAB-222', 'IAB-333'],
|
|
177
|
+
'mediaType': 'banner'
|
|
178
|
+
};
|
|
179
|
+
const admSample = "\u003cscript id=\"ayl-prebid-a11a121205932e75e622af275681965d\"\u003e\n(function(){\n\twindow.isPrebid = true\n\tvar prebidResults = /*PREBID*/{\"OnEvents\": {\"CLICK\": [{\"Kind\": \"PIXEL_URL\",\"Url\": \"https://testPixelCLICK.com/fake\"}],\"IMPRESSION\": [{\"Kind\": \"PIXEL_URL\",\"Url\": \"https://testPixelIMP.com/fake\"}, {\"Kind\": \"JAVASCRIPT_URL\",\"Url\": \"https://testJsIMP.com/fake.js\"}]},\"Disabled\": false,\"Attempt\": \"a11a121205932e75e622af275681965d\",\"ApiPrefix\": \"https://fo-api.omnitagjs.com/fo-api\",\"TrackingPrefix\": \"https://tracking.omnitagjs.com/tracking\",\"DynamicPrefix\": \"https://tag-dyn.omnitagjs.com/fo-dyn\",\"StaticPrefix\": \"https://fo-static.omnitagjs.com/fo-static\",\"BlobPrefix\": \"https://fo-api.omnitagjs.com/fo-api/blobs\",\"SspPrefix\": \"https://fo-ssp.omnitagjs.com/fo-ssp\",\"VisitorPrefix\": \"https://visitor.omnitagjs.com/visitor\",\"Trusted\": true,\"Placement\": \"e622af275681965d3095808561a1e510\",\"PlacementAccess\": \"ALL\",\"Site\": \"6e2df7a92203c3c7a25561ed63f25a27\",\"Lang\": \"EN\",\"SiteLogo\": null,\"HasSponsorImage\": true,\"ResizeIframe\": true,\"IntegrationConfig\": {\"Kind\": \"WIDGET\",\"Widget\": {\"ExtraStyleSheet\": \"\",\"Placeholders\": {\"Body\": {\"Color\": {\"R\": 77,\"G\": 21,\"B\": 82,\"A\": 100},\"BackgroundColor\": {\"R\": 255,\"G\": 255,\"B\": 255,\"A\": 100},\"FontFamily\": \"Lato\",\"Width\": \"100%\",\"Align\": \"\",\"BoxShadow\": true},\"CallToAction\": {\"Color\": {\"R\": 26,\"G\": 157,\"B\": 212,\"A\": 100}},\"Description\": {\"Length\": 130},\"Image\": {\"Width\": 600,\"Height\": 600,\"Lowres\": false,\"Raw\": false},\"Size\": {\"Height\": \"250px\",\"Width\": \"300px\"},\"Title\": {\"Color\": {\"R\": 219,\"G\": 181,\"B\": 255,\"A\": 100}}},\"Selector\": {\"Kind\": \"CSS\",\"Css\": \"#ayl-prebid-a11a121205932e75e622af275681965d\"},\"Insertion\": \"AFTER\",\"ClickFormat\": true,\"Creative20\": true,\"WidgetKind\": \"CREATIVE_TEMPLATE_4\"}},\"Legal\": \"Sponsored\",\"ForcedCampaign\": \"f1c80d4bb5643c222ae8de75e9b2f991\",\"ForcedTrack\": \"\",\"ForcedCreative\": \"\",\"ForcedSource\": \"\",\"DisplayMode\": \"DEFAULT\",\"Campaign\": \"f1c80d4bb5643c222ae8de75e9b2f991\",\"CampaignAccess\": \"ALL\",\"CampaignKind\": \"AD_TRAFFIC\",\"DataSource\": \"LOCAL\",\"DataSourceUrl\": \"\",\"DataSourceOnEventsIsolated\": false,\"DataSourceWithoutCookie\": false,\"Content\": {\"Preview\": {\"Thumbnail\": {\"Image\": {\"Kind\": \"EXTERNAL\",\"Data\": {\"External\": {\"Url\": \"https://tag-dyn.omnitagjs.com/fo-dyn/native/preview/image?key=fd4362d35bb174d6f1c80d4bb5643c22\\u0026kind=INTERNAL\\u0026ztop=0.000000\\u0026zleft=0.000000\\u0026zwidth=0.333333\\u0026zheight=1.000000\\u0026width=[width]\\u0026height=[height]\"}},\"ZoneTop\": 0,\"ZoneLeft\": 0,\"ZoneWidth\": 1,\"ZoneHeight\": 1,\"Smart\": false,\"NoTransform\": false,\"Quality\": \"NORMAL\"}},\"Text\": {\"CALLTOACTION\": \"Click here to learn more\",\"DESCRIPTION\": \"Considérant l'extrémité conjoncturelle, il serait bon d'anticiper toutes les voies de bon sens.\",\"SPONSOR\": \"Tested by\",\"TITLE\": \"Adserver Traffic Redirect Internal\"},\"Sponsor\": {\"Name\": \"QA Team\",\"Logo\": {\"Resource\": {\"Kind\": \"EXTERNAL\",\"Data\": {\"External\": {\"Url\": \"https://fo-static.omnitagjs.com/fo-static/native/images/info-ayl.svg\"}},\"ZoneTop\": 0,\"ZoneLeft\": 0,\"ZoneWidth\": 1,\"ZoneHeight\": 1,\"Smart\": false,\"NoTransform\": false,\"Quality\": \"NORMAL\"}}},\"Credit\": {\"Logo\": {\"Resource\": {\"Kind\": \"EXTERNAL\",\"Data\": {\"External\": {\"Url\": \"https://fo-static.omnitagjs.com/fo-static/native/images/info-ayl.png\"}},\"ZoneTop\": 0,\"ZoneLeft\": 0,\"ZoneWidth\": 1,\"ZoneHeight\": 1,\"Smart\": false,\"NoTransform\": false,\"Quality\": \"NORMAL\"}},\"Url\": \"https://blobs.omnitagjs.com/adchoice/\"}},\"Landing\": {\"Url\": \"https://www.w3.org/People/mimasa/test/xhtml/entities/entities-11.xhtml#lat1\",\"LegacyTracking\": false},\"ViewButtons\": {\"Close\": {\"Skip\": 6000}},\"InternalContentFields\": {\"AnimatedImage\": false}},\"AdDomain\": \"retailspot.com\",\"Opener\": \"REDIRECT\",\"PerformUITriggers\": [\"CLICK\"],\"RedirectionTarget\": \"TAB\"}/*PREBID*/;\n\tvar insertAds = function insertAds() {\insertAds();\n\t}\n})();\n\u003c/script\u003e";
|
|
180
|
+
const responseWithSinglePlacement = [
|
|
181
|
+
{
|
|
182
|
+
'requestId': 'bid_id_0',
|
|
183
|
+
'placement': 'placement_0',
|
|
184
|
+
'ad': admSample,
|
|
185
|
+
'cpm': 0.5,
|
|
186
|
+
'height': 250,
|
|
187
|
+
'width': 300,
|
|
188
|
+
'meta': testMetaObject,
|
|
189
|
+
'mediaType': 'banner'
|
|
190
|
+
}
|
|
191
|
+
];
|
|
192
|
+
|
|
193
|
+
const responseWithSingleVideo = [{
|
|
194
|
+
'requestId': 'bid_id_0',
|
|
195
|
+
'placement': 'placement_0',
|
|
196
|
+
'vastXml': 'PFZBU1Q+RW1wdHkgc2FtcGxlPC92YXN0Pg==',
|
|
197
|
+
'cpm': 0.5,
|
|
198
|
+
'height': 300,
|
|
199
|
+
'width': 530,
|
|
200
|
+
'mediaType': 'video',
|
|
201
|
+
'creativeId': 'testvideo123',
|
|
202
|
+
'netRevenue': true,
|
|
203
|
+
'currency': 'USD',
|
|
204
|
+
'adId': 'fakeAdID',
|
|
205
|
+
'dealId': 'fakeDealId'
|
|
206
|
+
}];
|
|
207
|
+
|
|
208
|
+
const videoResult = [{
|
|
209
|
+
bidderCode: 'retailspot',
|
|
210
|
+
cpm: 0.5,
|
|
211
|
+
creativeId: 'testvideo123',
|
|
212
|
+
currency: 'USD',
|
|
213
|
+
height: 300,
|
|
214
|
+
netRevenue: true,
|
|
215
|
+
requestId: 'bid_id_0',
|
|
216
|
+
ttl: 3600,
|
|
217
|
+
mediaType: 'video',
|
|
218
|
+
meta: {
|
|
219
|
+
advertiserDomains: ['retail-spot.io']
|
|
220
|
+
},
|
|
221
|
+
vastXml: '<VAST>Empty sample</vast>',
|
|
222
|
+
width: 530,
|
|
223
|
+
adId: 'fakeAdID',
|
|
224
|
+
dealId: 'fakeDealId'
|
|
225
|
+
}];
|
|
226
|
+
|
|
227
|
+
const responseWithMultiplePlacements = [
|
|
228
|
+
{
|
|
229
|
+
'requestId': 'bid_id_0',
|
|
230
|
+
'mediaType': 'banner',
|
|
231
|
+
'placement': 'placement_0',
|
|
232
|
+
'ad': 'placement_0',
|
|
233
|
+
'cpm': 0.5,
|
|
234
|
+
'height': 0, // test with wrong value
|
|
235
|
+
'width': 300,
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
'requestId': 'bid_id_1',
|
|
239
|
+
'mediaType': 'banner',
|
|
240
|
+
'placement': 'placement_1',
|
|
241
|
+
'ad': 'placement_1',
|
|
242
|
+
'cpm': 0.6,
|
|
243
|
+
'height': 250
|
|
244
|
+
// 'width' test with missing value
|
|
245
|
+
}
|
|
246
|
+
];
|
|
247
|
+
const adapter = newBidder(spec);
|
|
248
|
+
|
|
249
|
+
const DEV_URL = 'http://localhost:8090/';
|
|
250
|
+
|
|
251
|
+
describe('inherited functions', function () {
|
|
252
|
+
it('exists and is a function', function () {
|
|
253
|
+
expect(adapter.callBids).to.exist.and.to.be.a('function');
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
describe('isBidRequestValid', function () {
|
|
258
|
+
let bid = {
|
|
259
|
+
'bidId': 'bid_id_1',
|
|
260
|
+
'bidder': 'retailspot',
|
|
261
|
+
'placementCode': 'adunit/hb-1',
|
|
262
|
+
'params': {
|
|
263
|
+
'placement': 'placement_1'
|
|
264
|
+
},
|
|
265
|
+
'sizes': [[300, 600]],
|
|
266
|
+
'transactionId': 'bid_id_1_transaction_id'
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
let bidWSize = {
|
|
270
|
+
'bidId': 'bid_id_1',
|
|
271
|
+
'bidder': 'retailspot',
|
|
272
|
+
'placementCode': 'adunit/hb-1',
|
|
273
|
+
'params': {
|
|
274
|
+
'placement': 'placement_1',
|
|
275
|
+
'size': [250, 300],
|
|
276
|
+
},
|
|
277
|
+
'transactionId': 'bid_id_1_transaction_id'
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
it('should return true when required params found', function () {
|
|
281
|
+
expect(!!spec.isBidRequestValid(bid)).to.equal(true);
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it('should return true when required params found with size in bid params', function () {
|
|
285
|
+
expect(!!spec.isBidRequestValid(bidWSize)).to.equal(true);
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
it('should return false when required params are not passed', function () {
|
|
289
|
+
let bid = Object.assign({}, bid);
|
|
290
|
+
delete bid.size;
|
|
291
|
+
|
|
292
|
+
expect(!!spec.isBidRequestValid(bid)).to.equal(false);
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
it('should return false when required params are not passed', function () {
|
|
296
|
+
let bid = Object.assign({}, bid);
|
|
297
|
+
delete bid.params;
|
|
298
|
+
bid.params = {
|
|
299
|
+
'placement': 0
|
|
300
|
+
};
|
|
301
|
+
expect(!!spec.isBidRequestValid(bid)).to.equal(false);
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
describe('buildRequests', function () {
|
|
306
|
+
it('should add gdpr/usp consent information to the request', function () {
|
|
307
|
+
let consentString = 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A==';
|
|
308
|
+
let uspConsentData = '1YCC';
|
|
309
|
+
let bidderRequest = {
|
|
310
|
+
'auctionId': '1d1a030790a475',
|
|
311
|
+
'bidderRequestId': '22edbae2733bf6',
|
|
312
|
+
'timeout': 3000,
|
|
313
|
+
'gdprConsent': {
|
|
314
|
+
consentString: consentString,
|
|
315
|
+
gdprApplies: true
|
|
316
|
+
},
|
|
317
|
+
'uspConsent': uspConsentData
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
bidderRequest.Bids = bidRequestWithSinglePlacement;
|
|
321
|
+
|
|
322
|
+
const request = spec.buildRequests(bidRequestWithSinglePlacement, bidderRequest);
|
|
323
|
+
const payload = JSON.parse(request.data);
|
|
324
|
+
|
|
325
|
+
expect(payload.gdprConsent).to.exist;
|
|
326
|
+
expect(payload.gdprConsent.consentString).to.exist.and.to.equal(consentString);
|
|
327
|
+
expect(payload.uspConsent).to.exist.and.to.equal(uspConsentData);
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
it('sends bid request to endpoint with single placement', function () {
|
|
331
|
+
bidderRequest.Bids = bidRequestWithSinglePlacement;
|
|
332
|
+
|
|
333
|
+
const request = spec.buildRequests(bidRequestWithSinglePlacement, bidderRequest);
|
|
334
|
+
const payload = JSON.parse(request.data);
|
|
335
|
+
|
|
336
|
+
expect(request.url).to.contain('https://ssp.retail-spot.io/prebid');
|
|
337
|
+
expect(request.method).to.equal('POST');
|
|
338
|
+
|
|
339
|
+
expect(payload).to.deep.equal(bidderRequest);
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
it('sends bid request to endpoint with single placement multiple mediatype', function () {
|
|
343
|
+
bidderRequest.Bids = bidRequestWithMultipleMediatype;
|
|
344
|
+
const request = spec.buildRequests(bidRequestWithSinglePlacement, bidderRequest);
|
|
345
|
+
const payload = JSON.parse(request.data);
|
|
346
|
+
|
|
347
|
+
expect(request.url).to.contain('https://ssp.retail-spot.io/prebid');
|
|
348
|
+
expect(request.method).to.equal('POST');
|
|
349
|
+
|
|
350
|
+
expect(payload).to.deep.equal(bidderRequest);
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
it('sends bid request to endpoint with multiple placements', function () {
|
|
354
|
+
bidderRequest.Bids = bidRequestMultiPlacements;
|
|
355
|
+
const request = spec.buildRequests(bidRequestMultiPlacements, bidderRequest);
|
|
356
|
+
const payload = JSON.parse(request.data);
|
|
357
|
+
|
|
358
|
+
expect(request.url).to.contain('https://ssp.retail-spot.io/prebid');
|
|
359
|
+
expect(request.method).to.equal('POST');
|
|
360
|
+
|
|
361
|
+
expect(payload).to.deep.equal(bidderRequest);
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
it('sends bid request to endpoint setted by parameters', function () {
|
|
365
|
+
const request = spec.buildRequests(bidRequestWithDevPlacement, bidderRequest);
|
|
366
|
+
expect(request.url).to.contain(DEV_URL);
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
//
|
|
370
|
+
describe('interpretResponse', function () {
|
|
371
|
+
let serverResponse;
|
|
372
|
+
|
|
373
|
+
beforeEach(function () {
|
|
374
|
+
serverResponse = {
|
|
375
|
+
body: {}
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
it('handles nobid responses', function () {
|
|
380
|
+
let response = [{
|
|
381
|
+
requestId: '123dfsdf',
|
|
382
|
+
placement: '12df1'
|
|
383
|
+
}];
|
|
384
|
+
serverResponse.body = response;
|
|
385
|
+
let result = spec.interpretResponse(serverResponse, []);
|
|
386
|
+
expect(result).deep.equal([]);
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
it('receive reponse with single placement', function () {
|
|
390
|
+
serverResponse.body = responseWithSinglePlacement;
|
|
391
|
+
let result = spec.interpretResponse(serverResponse, {data: '{"bids":' + JSON.stringify(requestDataOnePlacement) + '}'});
|
|
392
|
+
|
|
393
|
+
expect(result.length).to.equal(1);
|
|
394
|
+
expect(result[0].cpm).to.equal(0.5);
|
|
395
|
+
expect(result[0].ad).to.equal(admSample);
|
|
396
|
+
expect(result[0].width).to.equal(300);
|
|
397
|
+
expect(result[0].height).to.equal(250);
|
|
398
|
+
expect(result[0].meta).to.deep.equal(testMetaObject);
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
it('receive reponse with multiple placement', function () {
|
|
402
|
+
serverResponse.body = responseWithMultiplePlacements;
|
|
403
|
+
let result = spec.interpretResponse(serverResponse, {data: '{"bids":' + JSON.stringify(requestDataMultiPlacement) + '}'});
|
|
404
|
+
|
|
405
|
+
expect(result.length).to.equal(2);
|
|
406
|
+
|
|
407
|
+
expect(result[0].cpm).to.equal(0.5);
|
|
408
|
+
expect(result[0].ad).to.equal('placement_0');
|
|
409
|
+
expect(result[0].width).to.equal(300);
|
|
410
|
+
expect(result[0].height).to.equal(600);
|
|
411
|
+
|
|
412
|
+
expect(result[1].cpm).to.equal(0.6);
|
|
413
|
+
expect(result[1].ad).to.equal('placement_1');
|
|
414
|
+
expect(result[1].width).to.equal(400);
|
|
415
|
+
expect(result[1].height).to.equal(250);
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
it('receive Vast reponse with Video ad', function () {
|
|
419
|
+
serverResponse.body = responseWithSingleVideo;
|
|
420
|
+
let result = spec.interpretResponse(serverResponse, {data: '{"bids":' + JSON.stringify(sentBidVideo) + '}'});
|
|
421
|
+
|
|
422
|
+
expect(result.length).to.equal(1);
|
|
423
|
+
expect(result).to.deep.equal(videoResult);
|
|
424
|
+
});
|
|
425
|
+
});
|
|
426
|
+
});
|
|
@@ -341,6 +341,24 @@ describe('riseAdapter', function () {
|
|
|
341
341
|
expect(request.data.bids[0]).to.be.an('object');
|
|
342
342
|
expect(request.data.bids[0]).to.have.property('floorPrice', 1.5);
|
|
343
343
|
});
|
|
344
|
+
|
|
345
|
+
describe('COPPA Param', function() {
|
|
346
|
+
it('should set coppa equal 0 in bid request if coppa is set to false', function() {
|
|
347
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
348
|
+
expect(request.data.bids[0].coppa).to.be.equal(0);
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
it('should set coppa equal 1 in bid request if coppa is set to true', function() {
|
|
352
|
+
const bid = utils.deepClone(bidRequests[0]);
|
|
353
|
+
bid.ortb2 = {
|
|
354
|
+
'regs': {
|
|
355
|
+
'coppa': true,
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
const request = spec.buildRequests([bid], bidderRequest);
|
|
359
|
+
expect(request.data.bids[0].coppa).to.be.equal(1);
|
|
360
|
+
});
|
|
361
|
+
});
|
|
344
362
|
});
|
|
345
363
|
|
|
346
364
|
describe('interpretResponse', function () {
|
|
@@ -232,6 +232,25 @@ describe('ttdBidAdapter', function () {
|
|
|
232
232
|
'doneCbCallCount': 0
|
|
233
233
|
};
|
|
234
234
|
|
|
235
|
+
const extFirstPartyDataValues = ['value', 'value2'];
|
|
236
|
+
const extFirstPartyData = {
|
|
237
|
+
data: {
|
|
238
|
+
firstPartyKey: 'firstPartyValue',
|
|
239
|
+
firstPartyKey2: extFirstPartyDataValues
|
|
240
|
+
},
|
|
241
|
+
custom: 'custom_data',
|
|
242
|
+
custom_kvp: {
|
|
243
|
+
customKey: 'customValue'
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function validateExtFirstPartyData(ext) {
|
|
248
|
+
expect(ext.data.firstPartyKey).to.equal('firstPartyValue');
|
|
249
|
+
expect(ext.data.firstPartyKey2).to.eql(extFirstPartyDataValues);
|
|
250
|
+
expect(ext.custom).to.equal('custom_data');
|
|
251
|
+
expect(ext.custom_kvp.customKey).to.equal('customValue');
|
|
252
|
+
}
|
|
253
|
+
|
|
235
254
|
it('sends bid request to our endpoint that makes sense', function () {
|
|
236
255
|
const request = testBuildRequests(baseBannerBidRequests, baseBidderRequest);
|
|
237
256
|
expect(request.method).to.equal('POST');
|
|
@@ -572,6 +591,115 @@ describe('ttdBidAdapter', function () {
|
|
|
572
591
|
config.resetConfig();
|
|
573
592
|
expect(requestBody.imp[0].bidfloor).to.equal(bidfloor);
|
|
574
593
|
});
|
|
594
|
+
|
|
595
|
+
it('adds default value for secure if not set to request', function () {
|
|
596
|
+
const requestBody = testBuildRequests(baseBannerBidRequests, baseBidderRequest).data;
|
|
597
|
+
expect(requestBody.imp[0].secure).to.equal(1);
|
|
598
|
+
});
|
|
599
|
+
|
|
600
|
+
it('adds secure to request', function () {
|
|
601
|
+
let clonedBannerRequests = deepClone(baseBannerBidRequests);
|
|
602
|
+
clonedBannerRequests[0].ortb2Imp.secure = 0;
|
|
603
|
+
|
|
604
|
+
let requestBody = testBuildRequests(clonedBannerRequests, baseBidderRequest).data;
|
|
605
|
+
expect(0).to.equal(requestBody.imp[0].secure);
|
|
606
|
+
|
|
607
|
+
clonedBannerRequests[0].ortb2Imp.secure = 1;
|
|
608
|
+
requestBody = testBuildRequests(clonedBannerRequests, baseBidderRequest).data;
|
|
609
|
+
expect(1).to.equal(requestBody.imp[0].secure);
|
|
610
|
+
});
|
|
611
|
+
|
|
612
|
+
it('adds all of site first party data to request', function() {
|
|
613
|
+
const ortb2 = {
|
|
614
|
+
site: {
|
|
615
|
+
ext: extFirstPartyData,
|
|
616
|
+
search: 'test search'
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
let clonedBidderRequest = {...deepClone(baseBidderRequest), ortb2};
|
|
621
|
+
const requestBody = testBuildRequests(baseBannerBidRequests, clonedBidderRequest).data;
|
|
622
|
+
|
|
623
|
+
validateExtFirstPartyData(requestBody.site.ext)
|
|
624
|
+
expect(requestBody.site.search).to.equal('test search')
|
|
625
|
+
});
|
|
626
|
+
|
|
627
|
+
it('adds all of user first party data to request', function() {
|
|
628
|
+
const ortb2 = {
|
|
629
|
+
user: {
|
|
630
|
+
ext: extFirstPartyData,
|
|
631
|
+
yob: 1998
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
|
|
635
|
+
let clonedBidderRequest = {...deepClone(baseBidderRequest), ortb2};
|
|
636
|
+
const requestBody = testBuildRequests(baseBannerBidRequests, clonedBidderRequest).data;
|
|
637
|
+
|
|
638
|
+
validateExtFirstPartyData(requestBody.user.ext)
|
|
639
|
+
expect(requestBody.user.yob).to.equal(1998)
|
|
640
|
+
});
|
|
641
|
+
|
|
642
|
+
it('adds all of imp first party data to request', function() {
|
|
643
|
+
const metric = { type: 'viewability', value: 0.8 };
|
|
644
|
+
let clonedBannerRequests = deepClone(baseBannerBidRequests);
|
|
645
|
+
clonedBannerRequests[0].ortb2Imp = {
|
|
646
|
+
ext: extFirstPartyData,
|
|
647
|
+
metric: [metric],
|
|
648
|
+
clickbrowser: 1
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
const requestBody = testBuildRequests(clonedBannerRequests, baseBidderRequest).data;
|
|
652
|
+
|
|
653
|
+
validateExtFirstPartyData(requestBody.imp[0].ext)
|
|
654
|
+
expect(requestBody.imp[0].tagid).to.equal('1gaa015');
|
|
655
|
+
expect(requestBody.imp[0].metric[0]).to.deep.equal(metric);
|
|
656
|
+
expect(requestBody.imp[0].clickbrowser).to.equal(1)
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
it('adds all of app first party data to request', function() {
|
|
660
|
+
const ortb2 = {
|
|
661
|
+
app: {
|
|
662
|
+
ext: extFirstPartyData,
|
|
663
|
+
ver: 'v1.0'
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
|
|
667
|
+
let clonedBidderRequest = {...deepClone(baseBidderRequest), ortb2};
|
|
668
|
+
const requestBody = testBuildRequests(baseBannerBidRequests, clonedBidderRequest).data;
|
|
669
|
+
|
|
670
|
+
validateExtFirstPartyData(requestBody.app.ext)
|
|
671
|
+
expect(requestBody.app.ver).to.equal('v1.0')
|
|
672
|
+
});
|
|
673
|
+
|
|
674
|
+
it('adds all of device first party data to request', function() {
|
|
675
|
+
const ortb2 = {
|
|
676
|
+
device: {
|
|
677
|
+
ext: extFirstPartyData,
|
|
678
|
+
os: 'iPhone'
|
|
679
|
+
}
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
let clonedBidderRequest = {...deepClone(baseBidderRequest), ortb2};
|
|
683
|
+
const requestBody = testBuildRequests(baseBannerBidRequests, clonedBidderRequest).data;
|
|
684
|
+
|
|
685
|
+
validateExtFirstPartyData(requestBody.device.ext)
|
|
686
|
+
expect(requestBody.device.os).to.equal('iPhone')
|
|
687
|
+
});
|
|
688
|
+
|
|
689
|
+
it('adds all of pmp first party data to request', function() {
|
|
690
|
+
const ortb2 = {
|
|
691
|
+
pmp: {
|
|
692
|
+
ext: extFirstPartyData,
|
|
693
|
+
private_auction: 1
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
let clonedBidderRequest = {...deepClone(baseBidderRequest), ortb2};
|
|
698
|
+
const requestBody = testBuildRequests(baseBannerBidRequests, clonedBidderRequest).data;
|
|
699
|
+
|
|
700
|
+
validateExtFirstPartyData(requestBody.pmp.ext)
|
|
701
|
+
expect(requestBody.pmp.private_auction).to.equal(1)
|
|
702
|
+
});
|
|
575
703
|
});
|
|
576
704
|
|
|
577
705
|
describe('buildRequests-banner-multiple', function () {
|
|
@@ -1295,8 +1423,7 @@ describe('ttdBidAdapter', function () {
|
|
|
1295
1423
|
}
|
|
1296
1424
|
};
|
|
1297
1425
|
|
|
1298
|
-
const expectedBid =
|
|
1299
|
-
{
|
|
1426
|
+
const expectedBid = {
|
|
1300
1427
|
'requestId': '2eabb87dfbcae4',
|
|
1301
1428
|
'cpm': 13.6,
|
|
1302
1429
|
'creativeId': 'mokivv6m',
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {expect} from 'chai';
|
|
2
2
|
import {
|
|
3
3
|
spec as adapter,
|
|
4
|
-
SUPPORTED_ID_SYSTEMS,
|
|
5
4
|
createDomain,
|
|
6
5
|
hashCode,
|
|
7
6
|
extractPID,
|
|
@@ -21,6 +20,8 @@ import {useFakeTimers} from 'sinon';
|
|
|
21
20
|
import {BANNER, VIDEO} from '../../../src/mediaTypes';
|
|
22
21
|
import {config} from '../../../src/config';
|
|
23
22
|
|
|
23
|
+
export const TEST_ID_SYSTEMS = ['britepoolid', 'criteoId', 'id5id', 'idl_env', 'lipb', 'netId', 'parrableId', 'pubcid', 'tdid', 'pubProvidedId'];
|
|
24
|
+
|
|
24
25
|
const SUB_DOMAIN = 'openrtb';
|
|
25
26
|
|
|
26
27
|
const BID = {
|
|
@@ -520,7 +521,7 @@ describe('VidazooBidAdapter', function () {
|
|
|
520
521
|
});
|
|
521
522
|
|
|
522
523
|
describe('user id system', function () {
|
|
523
|
-
|
|
524
|
+
TEST_ID_SYSTEMS.forEach((idSystemProvider) => {
|
|
524
525
|
const id = Date.now().toString();
|
|
525
526
|
const bid = utils.deepClone(BID);
|
|
526
527
|
|