Skip to content

Commit f11bcda

Browse files
Zeta global ssp bid adapter: add shortname param (prebid#8454)
* zeta_global_sspBidAdapter shortname was added * remove the trash Co-authored-by: Surovenko Alexey <[email protected]>
1 parent c434889 commit f11bcda

File tree

2 files changed

+38
-25
lines changed

2 files changed

+38
-25
lines changed

modules/zeta_global_sspBidAdapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const spec = {
9999
user: params.user ? params.user : {},
100100
app: params.app ? params.app : {},
101101
ext: {
102-
tags: params.tags ? params.tags : {},
102+
tags: {...params.tags, shortname: params.shortname},
103103
sid: params.sid ? params.sid : undefined
104104
}
105105
};

test/spec/modules/zeta_global_sspBidAdapter_spec.js

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,25 @@ describe('Zeta Ssp Bid Adapter', function () {
2525
}
2626
];
2727

28+
const params = {
29+
user: {
30+
uid: 222,
31+
buyeruid: 333
32+
},
33+
tags: {
34+
someTag: 444,
35+
},
36+
sid: 'publisherId',
37+
shortname: 'test_shortname',
38+
site: {
39+
page: 'testPage'
40+
},
41+
app: {
42+
bundle: 'testBundle'
43+
},
44+
test: 1
45+
};
46+
2847
const bannerRequest = [{
2948
bidId: 12345,
3049
auctionId: 67890,
@@ -41,18 +60,7 @@ describe('Zeta Ssp Bid Adapter', function () {
4160
consentString: 'consentString'
4261
},
4362
uspConsent: 'someCCPAString',
44-
params: {
45-
placement: 111,
46-
user: {
47-
uid: 222,
48-
buyeruid: 333
49-
},
50-
tags: {
51-
someTag: 444,
52-
sid: 'publisherId'
53-
},
54-
test: 1
55-
},
63+
params: params,
5664
userIdAsEids: eids
5765
}];
5866

@@ -72,18 +80,7 @@ describe('Zeta Ssp Bid Adapter', function () {
7280
refererInfo: {
7381
referer: 'http://www.zetaglobal.com/page?param=video'
7482
},
75-
params: {
76-
placement: 111,
77-
user: {
78-
uid: 222,
79-
buyeruid: 333
80-
},
81-
tags: {
82-
someTag: 444,
83-
sid: 'publisherId'
84-
},
85-
test: 1
86-
},
83+
params: params
8784
}];
8885

8986
it('Test the bid validation function', function () {
@@ -269,4 +266,20 @@ describe('Zeta Ssp Bid Adapter', function () {
269266

270267
expect(payload.imp[0].banner).to.be.undefined;
271268
});
269+
270+
it('Test required params in banner request', function () {
271+
const request = spec.buildRequests(bannerRequest, bannerRequest[0]);
272+
const payload = JSON.parse(request.data);
273+
expect(payload.ext.sid).to.eql('publisherId');
274+
expect(payload.ext.tags.someTag).to.eql(444);
275+
expect(payload.ext.tags.shortname).to.eql('test_shortname');
276+
});
277+
278+
it('Test required params in video request', function () {
279+
const request = spec.buildRequests(videoRequest, videoRequest[0]);
280+
const payload = JSON.parse(request.data);
281+
expect(payload.ext.sid).to.eql('publisherId');
282+
expect(payload.ext.tags.someTag).to.eql(444);
283+
expect(payload.ext.tags.shortname).to.eql('test_shortname');
284+
});
272285
});

0 commit comments

Comments
 (0)