prebid.js 6.22.0 → 6.23.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/33acrossIdSystem.js +1 -0
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adfBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.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/asealBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/audiencerunBidAdapter.js +1 -1
- package/dist/automatadBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bizzclickBidAdapter.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/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.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/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/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/jwplayerRtdProvider.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/livewrappedBidAdapter.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 +117 -116
- 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/prebidServerBidAdapter.js +1 -1
- 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/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/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/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/integrationExamples/gpt/userId_example.html +12 -0
- package/modules/.submodules.json +1 -0
- package/modules/33acrossIdSystem.js +115 -0
- package/modules/33acrossIdSystem.md +53 -0
- package/modules/adagioBidAdapter.js +45 -5
- package/modules/adfBidAdapter.js +5 -0
- package/modules/adyoulikeBidAdapter.js +1 -9
- package/modules/asealBidAdapter.js +62 -14
- package/modules/automatadBidAdapter.js +24 -11
- package/modules/automatadBidAdapter.md +2 -2
- package/modules/big-richmediaBidAdapter.js +9 -1
- package/modules/bizzclickBidAdapter.js +5 -14
- package/modules/criteoBidAdapter.js +20 -20
- package/modules/improvedigitalBidAdapter.js +10 -6
- package/modules/insticatorBidAdapter.js +14 -4
- package/modules/jixieBidAdapter.js +29 -0
- package/modules/jixieBidAdapter.md +1 -0
- package/modules/jwplayerRtdProvider.js +27 -9
- package/modules/jwplayerRtdProvider.md +5 -3
- package/modules/livewrappedBidAdapter.js +1 -1
- package/modules/minutemediaBidAdapter.js +206 -135
- package/modules/minutemediaBidAdapter.md +42 -17
- package/modules/prebidServerBidAdapter/index.js +4 -1
- package/modules/sovrnBidAdapter.js +16 -3
- package/modules/tripleliftBidAdapter.js +13 -9
- package/modules/userId/eids.js +9 -0
- package/modules/userId/eids.md +7 -0
- package/modules/userId/index.js +5 -2
- package/modules/userId/userId.md +23 -2
- package/package.json +1 -1
- package/test/spec/modules/33acrossIdSystem_spec.js +413 -0
- package/test/spec/modules/adagioBidAdapter_spec.js +11 -2
- package/test/spec/modules/adfBidAdapter_spec.js +27 -0
- package/test/spec/modules/asealBidAdapter_spec.js +134 -65
- package/test/spec/modules/automatadBidAdapter_spec.js +28 -11
- package/test/spec/modules/criteoBidAdapter_spec.js +33 -33
- package/test/spec/modules/eids_spec.js +17 -0
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +27 -5
- package/test/spec/modules/insticatorBidAdapter_spec.js +24 -15
- package/test/spec/modules/jixieBidAdapter_spec.js +96 -0
- package/test/spec/modules/jwplayerRtdProvider_spec.js +50 -14
- package/test/spec/modules/livewrappedBidAdapter_spec.js +3 -1
- package/test/spec/modules/minutemediaBidAdapter_spec.js +196 -122
- package/test/spec/modules/prebidServerBidAdapter_spec.js +4 -0
- package/test/spec/modules/sovrnBidAdapter_spec.js +12 -0
- package/test/spec/modules/tripleliftBidAdapter_spec.js +12 -2
- package/test/spec/modules/userId_spec.js +8 -0
- package/modules/pubnxBidAdapter.md +0 -31
|
@@ -1,120 +1,187 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
spec,
|
|
4
|
+
BIDDER_CODE,
|
|
5
|
+
API_ENDPOINT,
|
|
6
|
+
HEADER_AOTTER_VERSION,
|
|
7
|
+
WEB_SESSION_ID_KEY,
|
|
8
|
+
} from 'modules/asealBidAdapter.js';
|
|
9
|
+
import { getRefererInfo } from 'src/refererDetection.js';
|
|
3
10
|
import { newBidder } from 'src/adapters/bidderFactory.js';
|
|
4
11
|
import { config } from 'src/config.js';
|
|
12
|
+
import * as utils from 'src/utils.js';
|
|
13
|
+
import { storage } from 'modules/asealBidAdapter.js';
|
|
5
14
|
|
|
6
|
-
const TEST_CLIENT_ID = 'TEST_CLIENT_ID'
|
|
15
|
+
const TEST_CLIENT_ID = 'TEST_CLIENT_ID';
|
|
16
|
+
const TEST_WEB_SESSION_ID = 'TEST_WEB_SESSION_ID';
|
|
7
17
|
|
|
8
18
|
describe('asealBidAdapter', () => {
|
|
9
19
|
const adapter = newBidder(spec);
|
|
10
20
|
|
|
21
|
+
let localStorageIsEnabledStub;
|
|
22
|
+
let getDataFromLocalStorageStub;
|
|
23
|
+
let sandbox;
|
|
24
|
+
let w;
|
|
25
|
+
|
|
26
|
+
beforeEach((done) => {
|
|
27
|
+
localStorageIsEnabledStub = sinon.stub(storage, 'localStorageIsEnabled');
|
|
28
|
+
getDataFromLocalStorageStub = sinon.stub(
|
|
29
|
+
storage,
|
|
30
|
+
'getDataFromLocalStorage'
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
w = {
|
|
34
|
+
document: {
|
|
35
|
+
title: 'Aseal',
|
|
36
|
+
referrer: 'https://aseal.in/',
|
|
37
|
+
href: 'https://aseal.in/',
|
|
38
|
+
},
|
|
39
|
+
location: {
|
|
40
|
+
href: 'https://aseal.in/',
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
sandbox = sinon.sandbox.create();
|
|
45
|
+
sandbox.stub(utils, 'getWindowTop').returns(w);
|
|
46
|
+
sandbox.stub(utils, 'getWindowSelf').returns(w);
|
|
47
|
+
done();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
afterEach(() => {
|
|
51
|
+
localStorageIsEnabledStub.restore();
|
|
52
|
+
getDataFromLocalStorageStub.restore();
|
|
53
|
+
sandbox.restore();
|
|
54
|
+
config.resetConfig();
|
|
55
|
+
});
|
|
56
|
+
|
|
11
57
|
describe('inherited functions', () => {
|
|
12
58
|
it('exists and is a function', () => {
|
|
13
|
-
expect(adapter.callBids).to.exist.and.to.be.a('function')
|
|
14
|
-
})
|
|
59
|
+
expect(adapter.callBids).to.exist.and.to.be.a('function');
|
|
60
|
+
});
|
|
15
61
|
});
|
|
16
62
|
|
|
17
63
|
describe('isBidRequestValid', () => {
|
|
18
64
|
const bid = {
|
|
19
65
|
bidder: 'aseal',
|
|
20
66
|
params: {
|
|
21
|
-
placeUid: '123'
|
|
22
|
-
}
|
|
67
|
+
placeUid: '123',
|
|
68
|
+
},
|
|
23
69
|
};
|
|
24
70
|
|
|
25
71
|
it('should return true when required params found', () => {
|
|
26
|
-
expect(spec.isBidRequestValid(bid)).to.equal(true)
|
|
72
|
+
expect(spec.isBidRequestValid(bid)).to.equal(true);
|
|
27
73
|
});
|
|
28
74
|
|
|
29
75
|
it('should return false when required param placeUid is not passed', () => {
|
|
30
76
|
bid.params = {
|
|
31
|
-
placeUid: ''
|
|
32
|
-
}
|
|
33
|
-
expect(spec.isBidRequestValid(bid)).to.equal(false)
|
|
77
|
+
placeUid: '',
|
|
78
|
+
};
|
|
79
|
+
expect(spec.isBidRequestValid(bid)).to.equal(false);
|
|
34
80
|
});
|
|
35
81
|
|
|
36
82
|
it('should return false when required param placeUid is wrong type', () => {
|
|
37
83
|
bid.params = {
|
|
38
|
-
placeUid: null
|
|
39
|
-
}
|
|
40
|
-
expect(spec.isBidRequestValid(bid)).to.equal(false)
|
|
84
|
+
placeUid: null,
|
|
85
|
+
};
|
|
86
|
+
expect(spec.isBidRequestValid(bid)).to.equal(false);
|
|
41
87
|
});
|
|
42
88
|
|
|
43
89
|
it('should return false when required params are not passed', () => {
|
|
44
90
|
let bid = Object.assign({}, bid);
|
|
45
91
|
delete bid.params;
|
|
46
92
|
bid.params = {};
|
|
47
|
-
expect(spec.isBidRequestValid(bid)).to.equal(false)
|
|
48
|
-
})
|
|
93
|
+
expect(spec.isBidRequestValid(bid)).to.equal(false);
|
|
94
|
+
});
|
|
49
95
|
});
|
|
50
96
|
|
|
51
97
|
describe('buildRequests', () => {
|
|
52
|
-
afterEach(() => {
|
|
53
|
-
config.resetConfig();
|
|
54
|
-
});
|
|
55
|
-
|
|
56
98
|
it('should return an empty array when there are no bid requests', () => {
|
|
57
|
-
const bidRequests = []
|
|
58
|
-
const request = spec.buildRequests(bidRequests)
|
|
99
|
+
const bidRequests = [];
|
|
100
|
+
const request = spec.buildRequests(bidRequests);
|
|
59
101
|
|
|
60
|
-
expect(request).to.be.an('array').that.is.empty
|
|
102
|
+
expect(request).to.be.an('array').that.is.empty;
|
|
61
103
|
});
|
|
62
104
|
|
|
63
105
|
it('should send `x-aotter-clientid` header as empty string when user not set config `clientId`', () => {
|
|
64
|
-
const bidRequests = [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
106
|
+
const bidRequests = [
|
|
107
|
+
{
|
|
108
|
+
bidder: BIDDER_CODE,
|
|
109
|
+
params: {
|
|
110
|
+
placeUid: '123',
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
];
|
|
114
|
+
|
|
115
|
+
const bidderRequest = {};
|
|
72
116
|
const request = spec.buildRequests(bidRequests, bidderRequest)[0];
|
|
73
117
|
|
|
74
|
-
expect(request.options.customHeaders['x-aotter-clientid']).equal('')
|
|
75
|
-
})
|
|
118
|
+
expect(request.options.customHeaders['x-aotter-clientid']).equal('');
|
|
119
|
+
});
|
|
76
120
|
|
|
77
121
|
it('should send bid requests to ENDPOINT via POST', () => {
|
|
78
|
-
const bidRequests = [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
122
|
+
const bidRequests = [
|
|
123
|
+
{
|
|
124
|
+
bidder: BIDDER_CODE,
|
|
125
|
+
params: {
|
|
126
|
+
placeUid: '123',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
];
|
|
84
130
|
|
|
85
131
|
const bidderRequest = {
|
|
86
|
-
refererInfo:
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
}
|
|
132
|
+
refererInfo: getRefererInfo(),
|
|
133
|
+
};
|
|
90
134
|
|
|
91
135
|
config.setConfig({
|
|
92
136
|
aseal: {
|
|
93
|
-
clientId: TEST_CLIENT_ID
|
|
94
|
-
}
|
|
137
|
+
clientId: TEST_CLIENT_ID,
|
|
138
|
+
},
|
|
95
139
|
});
|
|
140
|
+
|
|
141
|
+
localStorageIsEnabledStub.returns(true);
|
|
142
|
+
getDataFromLocalStorageStub
|
|
143
|
+
.withArgs(WEB_SESSION_ID_KEY)
|
|
144
|
+
.returns(TEST_WEB_SESSION_ID);
|
|
145
|
+
|
|
96
146
|
const request = spec.buildRequests(bidRequests, bidderRequest)[0];
|
|
97
147
|
|
|
148
|
+
utils.getWindowTop.restore();
|
|
149
|
+
utils.getWindowSelf.restore();
|
|
150
|
+
|
|
151
|
+
sandbox.stub(utils, 'getWindowTop').returns(w);
|
|
152
|
+
sandbox.stub(utils, 'getWindowSelf').returns(w);
|
|
153
|
+
|
|
154
|
+
const payload = {
|
|
155
|
+
meta: {
|
|
156
|
+
dr: w.document.referrer,
|
|
157
|
+
drs: w.document.referrer,
|
|
158
|
+
drt: w.document.referrer,
|
|
159
|
+
dt: w.document.title,
|
|
160
|
+
dl: w.location.href,
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
|
|
98
164
|
expect(request.url).to.equal(API_ENDPOINT);
|
|
99
|
-
expect(request.method).to.equal('POST')
|
|
165
|
+
expect(request.method).to.equal('POST');
|
|
100
166
|
expect(request.options).deep.equal({
|
|
101
167
|
contentType: 'application/json',
|
|
102
168
|
withCredentials: true,
|
|
103
169
|
customHeaders: {
|
|
104
170
|
'x-aotter-clientid': TEST_CLIENT_ID,
|
|
105
171
|
'x-aotter-version': HEADER_AOTTER_VERSION,
|
|
106
|
-
}
|
|
172
|
+
},
|
|
107
173
|
});
|
|
108
|
-
expect(request.data).deep.equal(
|
|
109
|
-
|
|
110
|
-
|
|
174
|
+
expect(request.data.bids).deep.equal(bidRequests);
|
|
175
|
+
expect(request.data.payload).deep.equal(payload);
|
|
176
|
+
expect(request.data.device).deep.equal({
|
|
177
|
+
webSessionId: TEST_WEB_SESSION_ID,
|
|
111
178
|
});
|
|
112
179
|
});
|
|
113
180
|
});
|
|
114
181
|
|
|
115
182
|
describe('interpretResponse', () => {
|
|
116
183
|
it('should return an empty array when there are no bids', () => {
|
|
117
|
-
const serverResponse = {}
|
|
184
|
+
const serverResponse = {};
|
|
118
185
|
const response = spec.interpretResponse(serverResponse);
|
|
119
186
|
|
|
120
187
|
expect(response).is.an('array').that.is.empty;
|
|
@@ -122,23 +189,25 @@ describe('asealBidAdapter', () => {
|
|
|
122
189
|
|
|
123
190
|
it('should get correct bid response', () => {
|
|
124
191
|
const serverResponse = {
|
|
125
|
-
body: [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
192
|
+
body: [
|
|
193
|
+
{
|
|
194
|
+
requestId: '2ef08f145b7a4f',
|
|
195
|
+
cpm: 3,
|
|
196
|
+
width: 300,
|
|
197
|
+
height: 250,
|
|
198
|
+
creativeId: '123abc',
|
|
199
|
+
dealId: '123abc',
|
|
200
|
+
currency: 'USD',
|
|
201
|
+
netRevenue: false,
|
|
202
|
+
mediaType: 'banner',
|
|
203
|
+
ttl: 300,
|
|
204
|
+
ad: '<!-- adtag -->',
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
};
|
|
139
208
|
const response = spec.interpretResponse(serverResponse);
|
|
140
209
|
|
|
141
210
|
expect(response).deep.equal(serverResponse.body);
|
|
142
211
|
});
|
|
143
|
-
})
|
|
212
|
+
});
|
|
144
213
|
});
|
|
@@ -5,7 +5,25 @@ import { newBidder } from 'src/adapters/bidderFactory.js'
|
|
|
5
5
|
describe('automatadBidAdapter', function () {
|
|
6
6
|
const adapter = newBidder(spec)
|
|
7
7
|
|
|
8
|
-
let
|
|
8
|
+
let bidRequestRequiredParams = {
|
|
9
|
+
bidder: 'automatad',
|
|
10
|
+
params: {siteId: '123ad'},
|
|
11
|
+
mediaTypes: {
|
|
12
|
+
banner: {
|
|
13
|
+
sizes: [[300, 600]],
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
adUnitCode: 'some-ad-unit-code',
|
|
17
|
+
transactionId: '1465569e-52cc-4c36-88a1-7174cfef4b44',
|
|
18
|
+
sizes: [[300, 600]],
|
|
19
|
+
bidId: '123abc',
|
|
20
|
+
bidderRequestId: '3213887463c059',
|
|
21
|
+
auctionId: 'abc-123',
|
|
22
|
+
src: 'client',
|
|
23
|
+
bidRequestsCount: 1
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let bidRequestAllParams = {
|
|
9
27
|
bidder: 'automatad',
|
|
10
28
|
params: {siteId: '123ad', placementId: '123abc345'},
|
|
11
29
|
mediaTypes: {
|
|
@@ -59,10 +77,14 @@ describe('automatadBidAdapter', function () {
|
|
|
59
77
|
})
|
|
60
78
|
|
|
61
79
|
describe('isBidRequestValid', function () {
|
|
62
|
-
let inValidBid = Object.assign({},
|
|
80
|
+
let inValidBid = Object.assign({}, bidRequestRequiredParams)
|
|
63
81
|
delete inValidBid.params
|
|
64
82
|
it('should return true if all params present', function () {
|
|
65
|
-
expect(spec.isBidRequestValid(
|
|
83
|
+
expect(spec.isBidRequestValid(bidRequestAllParams)).to.equal(true)
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
it('should return true if only required params present', function() {
|
|
87
|
+
expect(spec.isBidRequestValid(bidRequestRequiredParams)).to.equal(true)
|
|
66
88
|
})
|
|
67
89
|
|
|
68
90
|
it('should return false if any parameter missing', function () {
|
|
@@ -71,7 +93,7 @@ describe('automatadBidAdapter', function () {
|
|
|
71
93
|
})
|
|
72
94
|
|
|
73
95
|
describe('buildRequests', function () {
|
|
74
|
-
let req = spec.buildRequests([
|
|
96
|
+
let req = spec.buildRequests([ bidRequestRequiredParams ], { refererInfo: { } })
|
|
75
97
|
let rdata
|
|
76
98
|
|
|
77
99
|
it('should return request object', function () {
|
|
@@ -87,9 +109,9 @@ describe('automatadBidAdapter', function () {
|
|
|
87
109
|
expect(rdata.imp.length).to.equal(1)
|
|
88
110
|
})
|
|
89
111
|
|
|
90
|
-
it('should include
|
|
112
|
+
it('should include siteId', function () {
|
|
91
113
|
let r = rdata.imp[0]
|
|
92
|
-
expect(r.
|
|
114
|
+
expect(r.siteId !== null).to.be.true
|
|
93
115
|
})
|
|
94
116
|
|
|
95
117
|
it('should include media types', function () {
|
|
@@ -97,11 +119,6 @@ describe('automatadBidAdapter', function () {
|
|
|
97
119
|
expect(r.media_types !== null).to.be.true
|
|
98
120
|
})
|
|
99
121
|
|
|
100
|
-
it('should include all publisher params', function () {
|
|
101
|
-
let r = rdata.imp[0]
|
|
102
|
-
expect(r.siteID !== null && r.placementID !== null).to.be.true
|
|
103
|
-
})
|
|
104
|
-
|
|
105
122
|
it('should include adunit code', function () {
|
|
106
123
|
let r = rdata.imp[0]
|
|
107
124
|
expect(r.adUnitCode !== null).to.be.true
|
|
@@ -23,7 +23,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
23
23
|
sandbox = sinon.sandbox.create();
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
afterEach(function() {
|
|
26
|
+
afterEach(function () {
|
|
27
27
|
global.Criteo = undefined;
|
|
28
28
|
utilsMock.restore();
|
|
29
29
|
sandbox.restore();
|
|
@@ -457,7 +457,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
457
457
|
params: {
|
|
458
458
|
zoneId: 123,
|
|
459
459
|
publisherSubId: '123',
|
|
460
|
-
nativeCallback: function() {},
|
|
460
|
+
nativeCallback: function () { },
|
|
461
461
|
integrationMode: 'amp'
|
|
462
462
|
},
|
|
463
463
|
},
|
|
@@ -521,7 +521,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
521
521
|
}
|
|
522
522
|
},
|
|
523
523
|
params: {
|
|
524
|
-
nativeCallback: function() {}
|
|
524
|
+
nativeCallback: function () { }
|
|
525
525
|
},
|
|
526
526
|
},
|
|
527
527
|
];
|
|
@@ -540,7 +540,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
540
540
|
}
|
|
541
541
|
},
|
|
542
542
|
params: {
|
|
543
|
-
nativeCallback: function() {}
|
|
543
|
+
nativeCallback: function () { }
|
|
544
544
|
},
|
|
545
545
|
},
|
|
546
546
|
];
|
|
@@ -852,7 +852,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
852
852
|
sizes: [[300, 250]],
|
|
853
853
|
mediaTypes: {
|
|
854
854
|
video: {
|
|
855
|
-
playerSize: [
|
|
855
|
+
playerSize: [[300, 250]],
|
|
856
856
|
mimes: ['video/mp4', 'video/MPV', 'video/H264', 'video/webm', 'video/ogg'],
|
|
857
857
|
minduration: 1,
|
|
858
858
|
maxduration: 30,
|
|
@@ -970,7 +970,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
970
970
|
});
|
|
971
971
|
|
|
972
972
|
it('should properly build a request with first party data', function () {
|
|
973
|
-
const
|
|
973
|
+
const siteData = {
|
|
974
974
|
keywords: ['power tools'],
|
|
975
975
|
ext: {
|
|
976
976
|
data: {
|
|
@@ -1015,7 +1015,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1015
1015
|
sandbox.stub(config, 'getConfig').callsFake(key => {
|
|
1016
1016
|
const config = {
|
|
1017
1017
|
ortb2: {
|
|
1018
|
-
site:
|
|
1018
|
+
site: siteData,
|
|
1019
1019
|
user: userData
|
|
1020
1020
|
}
|
|
1021
1021
|
};
|
|
@@ -1023,8 +1023,8 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1023
1023
|
});
|
|
1024
1024
|
|
|
1025
1025
|
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
1026
|
-
expect(request.data.publisher.ext).to.deep.equal({
|
|
1027
|
-
expect(request.data.user.ext).to.deep.equal({
|
|
1026
|
+
expect(request.data.publisher.ext).to.deep.equal({ data: { pageType: 'article' } });
|
|
1027
|
+
expect(request.data.user.ext).to.deep.equal({ data: { registered: true } });
|
|
1028
1028
|
expect(request.data.slots[0].ext).to.deep.equal({
|
|
1029
1029
|
bidfloor: 0.75,
|
|
1030
1030
|
data: {
|
|
@@ -1171,13 +1171,13 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1171
1171
|
'advertiser': {
|
|
1172
1172
|
'description': 'sponsor',
|
|
1173
1173
|
'domain': 'criteo.com',
|
|
1174
|
-
'logo': {'url': 'https://www.criteo.com/images/criteo-logo.svg', 'height': 300, 'width': 300}
|
|
1174
|
+
'logo': { 'url': 'https://www.criteo.com/images/criteo-logo.svg', 'height': 300, 'width': 300 }
|
|
1175
1175
|
},
|
|
1176
1176
|
'privacy': {
|
|
1177
1177
|
'optout_click_url': 'https://info.criteo.com/privacy/informations',
|
|
1178
1178
|
'optout_image_url': 'https://static.criteo.net/flash/icon/nai_small.png',
|
|
1179
1179
|
},
|
|
1180
|
-
'impression_pixels': [{'url': 'https://my-impression-pixel/test/impression'}, {'url': 'https://cas.com/lg.com'}]
|
|
1180
|
+
'impression_pixels': [{ 'url': 'https://my-impression-pixel/test/impression' }, { 'url': 'https://cas.com/lg.com' }]
|
|
1181
1181
|
}
|
|
1182
1182
|
}],
|
|
1183
1183
|
},
|
|
@@ -1201,7 +1201,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1201
1201
|
});
|
|
1202
1202
|
|
|
1203
1203
|
it('should warn only once if sendTargetingKeys set to true on required fields for native bidRequest', () => {
|
|
1204
|
-
const bidderRequest = {
|
|
1204
|
+
const bidderRequest = {};
|
|
1205
1205
|
const bidRequests = [
|
|
1206
1206
|
{
|
|
1207
1207
|
bidder: 'criteo',
|
|
@@ -1211,7 +1211,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1211
1211
|
params: {
|
|
1212
1212
|
zoneId: 123,
|
|
1213
1213
|
publisherSubId: '123',
|
|
1214
|
-
nativeCallback: function() {}
|
|
1214
|
+
nativeCallback: function () { }
|
|
1215
1215
|
},
|
|
1216
1216
|
},
|
|
1217
1217
|
{
|
|
@@ -1222,7 +1222,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1222
1222
|
params: {
|
|
1223
1223
|
zoneId: 456,
|
|
1224
1224
|
publisherSubId: '456',
|
|
1225
|
-
nativeCallback: function() {}
|
|
1225
|
+
nativeCallback: function () { }
|
|
1226
1226
|
},
|
|
1227
1227
|
},
|
|
1228
1228
|
];
|
|
@@ -1276,7 +1276,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1276
1276
|
.withArgs('Criteo: all native assets containing URL should be sent as placeholders with sendId(icon, image, clickUrl, displayUrl, privacyLink, privacyIcon)')
|
|
1277
1277
|
.exactly(nativeParamsWithSendTargetingKeys.length * bidRequests.length);
|
|
1278
1278
|
nativeParamsWithSendTargetingKeys.forEach(nativeParams => {
|
|
1279
|
-
let transformedBidRequests = {...bidRequests};
|
|
1279
|
+
let transformedBidRequests = { ...bidRequests };
|
|
1280
1280
|
transformedBidRequests = [Object.assign(transformedBidRequests[0], nativeParams), Object.assign(transformedBidRequests[1], nativeParams)];
|
|
1281
1281
|
spec.buildRequests(transformedBidRequests, bidderRequest);
|
|
1282
1282
|
});
|
|
@@ -1440,7 +1440,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1440
1440
|
|
|
1441
1441
|
describe('when pubtag prebid adapter is not available', function () {
|
|
1442
1442
|
it('should not warn if sendId is provided on required fields for native bidRequest', () => {
|
|
1443
|
-
const bidderRequest = {
|
|
1443
|
+
const bidderRequest = {};
|
|
1444
1444
|
const bidRequestsWithSendId = [
|
|
1445
1445
|
{
|
|
1446
1446
|
bidder: 'criteo',
|
|
@@ -1450,7 +1450,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1450
1450
|
params: {
|
|
1451
1451
|
zoneId: 123,
|
|
1452
1452
|
publisherSubId: '123',
|
|
1453
|
-
nativeCallback: function() {}
|
|
1453
|
+
nativeCallback: function () { }
|
|
1454
1454
|
},
|
|
1455
1455
|
nativeParams: {
|
|
1456
1456
|
image: {
|
|
@@ -1481,7 +1481,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1481
1481
|
});
|
|
1482
1482
|
|
|
1483
1483
|
it('should warn only once if sendId is not provided on required fields for native bidRequest', () => {
|
|
1484
|
-
const bidderRequest = {
|
|
1484
|
+
const bidderRequest = {};
|
|
1485
1485
|
const bidRequests = [
|
|
1486
1486
|
{
|
|
1487
1487
|
bidder: 'criteo',
|
|
@@ -1491,7 +1491,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1491
1491
|
params: {
|
|
1492
1492
|
zoneId: 123,
|
|
1493
1493
|
publisherSubId: '123',
|
|
1494
|
-
nativeCallback: function() {}
|
|
1494
|
+
nativeCallback: function () { }
|
|
1495
1495
|
},
|
|
1496
1496
|
},
|
|
1497
1497
|
{
|
|
@@ -1502,7 +1502,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1502
1502
|
params: {
|
|
1503
1503
|
zoneId: 456,
|
|
1504
1504
|
publisherSubId: '456',
|
|
1505
|
-
nativeCallback: function() {}
|
|
1505
|
+
nativeCallback: function () { }
|
|
1506
1506
|
},
|
|
1507
1507
|
},
|
|
1508
1508
|
];
|
|
@@ -1556,7 +1556,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1556
1556
|
.withArgs('Criteo: all native assets containing URL should be sent as placeholders with sendId(icon, image, clickUrl, displayUrl, privacyLink, privacyIcon)')
|
|
1557
1557
|
.exactly(nativeParamsWithoutSendId.length * bidRequests.length);
|
|
1558
1558
|
nativeParamsWithoutSendId.forEach(nativeParams => {
|
|
1559
|
-
let transformedBidRequests = {...bidRequests};
|
|
1559
|
+
let transformedBidRequests = { ...bidRequests };
|
|
1560
1560
|
transformedBidRequests = [Object.assign(transformedBidRequests[0], nativeParams), Object.assign(transformedBidRequests[1], nativeParams)];
|
|
1561
1561
|
spec.buildRequests(transformedBidRequests, bidderRequest);
|
|
1562
1562
|
});
|
|
@@ -1569,10 +1569,10 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1569
1569
|
const response = {};
|
|
1570
1570
|
const request = {};
|
|
1571
1571
|
|
|
1572
|
-
const adapter = { interpretResponse: function() {} };
|
|
1572
|
+
const adapter = { interpretResponse: function () { } };
|
|
1573
1573
|
const adapterMock = sinon.mock(adapter);
|
|
1574
1574
|
adapterMock.expects('interpretResponse').withExactArgs(response, request).once().returns('ok');
|
|
1575
|
-
const prebidAdapter = { GetAdapter: function() {} };
|
|
1575
|
+
const prebidAdapter = { GetAdapter: function () { } };
|
|
1576
1576
|
const prebidAdapterMock = sinon.mock(prebidAdapter);
|
|
1577
1577
|
prebidAdapterMock.expects('GetAdapter').withExactArgs(request).once().returns(adapter);
|
|
1578
1578
|
|
|
@@ -1592,10 +1592,10 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1592
1592
|
it('should forward bid to pubtag when calling onBidWon', () => {
|
|
1593
1593
|
const bid = { auctionId: 123 };
|
|
1594
1594
|
|
|
1595
|
-
const adapter = { handleBidWon: function() {} };
|
|
1595
|
+
const adapter = { handleBidWon: function () { } };
|
|
1596
1596
|
const adapterMock = sinon.mock(adapter);
|
|
1597
1597
|
adapterMock.expects('handleBidWon').withExactArgs(bid).once();
|
|
1598
|
-
const prebidAdapter = { GetAdapter: function() {} };
|
|
1598
|
+
const prebidAdapter = { GetAdapter: function () { } };
|
|
1599
1599
|
const prebidAdapterMock = sinon.mock(prebidAdapter);
|
|
1600
1600
|
prebidAdapterMock.expects('GetAdapter').withExactArgs(bid.auctionId).once().returns(adapter);
|
|
1601
1601
|
|
|
@@ -1615,10 +1615,10 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1615
1615
|
it('should forward bid to pubtag when calling onSetTargeting', () => {
|
|
1616
1616
|
const bid = { auctionId: 123 };
|
|
1617
1617
|
|
|
1618
|
-
const adapter = { handleSetTargeting: function() {} };
|
|
1618
|
+
const adapter = { handleSetTargeting: function () { } };
|
|
1619
1619
|
const adapterMock = sinon.mock(adapter);
|
|
1620
1620
|
adapterMock.expects('handleSetTargeting').withExactArgs(bid).once();
|
|
1621
|
-
const prebidAdapter = { GetAdapter: function() {} };
|
|
1621
|
+
const prebidAdapter = { GetAdapter: function () { } };
|
|
1622
1622
|
const prebidAdapterMock = sinon.mock(prebidAdapter);
|
|
1623
1623
|
prebidAdapterMock.expects('GetAdapter').withExactArgs(bid.auctionId).once().returns(adapter);
|
|
1624
1624
|
|
|
@@ -1638,10 +1638,10 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1638
1638
|
it('should forward bid to pubtag when calling onTimeout', () => {
|
|
1639
1639
|
const timeoutData = [{ auctionId: 123 }];
|
|
1640
1640
|
|
|
1641
|
-
const adapter = { handleBidTimeout: function() {} };
|
|
1641
|
+
const adapter = { handleBidTimeout: function () { } };
|
|
1642
1642
|
const adapterMock = sinon.mock(adapter);
|
|
1643
1643
|
adapterMock.expects('handleBidTimeout').once();
|
|
1644
|
-
const prebidAdapter = { GetAdapter: function() {} };
|
|
1644
|
+
const prebidAdapter = { GetAdapter: function () { } };
|
|
1645
1645
|
const prebidAdapterMock = sinon.mock(prebidAdapter);
|
|
1646
1646
|
prebidAdapterMock.expects('GetAdapter').withExactArgs(timeoutData[0].auctionId).once().returns(adapter);
|
|
1647
1647
|
|
|
@@ -1659,15 +1659,15 @@ describe('The Criteo bidding adapter', function () {
|
|
|
1659
1659
|
});
|
|
1660
1660
|
|
|
1661
1661
|
it('should return a POST method with url & data from pubtag', () => {
|
|
1662
|
-
const bidRequests = {
|
|
1663
|
-
const bidderRequest = {
|
|
1662
|
+
const bidRequests = {};
|
|
1663
|
+
const bidderRequest = {};
|
|
1664
1664
|
|
|
1665
|
-
const prebidAdapter = { buildCdbUrl: function() {}, buildCdbRequest: function() {} };
|
|
1665
|
+
const prebidAdapter = { buildCdbUrl: function () { }, buildCdbRequest: function () { } };
|
|
1666
1666
|
const prebidAdapterMock = sinon.mock(prebidAdapter);
|
|
1667
1667
|
prebidAdapterMock.expects('buildCdbUrl').once().returns('cdbUrl');
|
|
1668
1668
|
prebidAdapterMock.expects('buildCdbRequest').once().returns('cdbRequest');
|
|
1669
1669
|
|
|
1670
|
-
const adapters = { Prebid: function() {} };
|
|
1670
|
+
const adapters = { Prebid: function () { } };
|
|
1671
1671
|
const adaptersMock = sinon.mock(adapters);
|
|
1672
1672
|
adaptersMock.expects('Prebid').withExactArgs(PROFILE_ID_PUBLISHERTAG, ADAPTER_VERSION, bidRequests, bidderRequest, '$prebid.version$').once().returns(prebidAdapter);
|
|
1673
1673
|
|
|
@@ -363,6 +363,23 @@ describe('eids array generation for known sub-modules', function() {
|
|
|
363
363
|
}]
|
|
364
364
|
});
|
|
365
365
|
});
|
|
366
|
+
|
|
367
|
+
it('33acrossId', function() {
|
|
368
|
+
const userId = {
|
|
369
|
+
'33acrossId': {
|
|
370
|
+
envelope: 'some-random-id-value'
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
const newEids = createEidsArray(userId);
|
|
374
|
+
expect(newEids.length).to.equal(1);
|
|
375
|
+
expect(newEids[0]).to.deep.equal({
|
|
376
|
+
source: '33across.com',
|
|
377
|
+
uids: [{
|
|
378
|
+
id: 'some-random-id-value',
|
|
379
|
+
atype: 1
|
|
380
|
+
}]
|
|
381
|
+
});
|
|
382
|
+
});
|
|
366
383
|
});
|
|
367
384
|
describe('Negative case', function() {
|
|
368
385
|
it('eids array generation for UN-known sub-module', function() {
|