Skip to content

Commit

Permalink
Zeta global ssp bid adapter: add shortname param (prebid#8454)
Browse files Browse the repository at this point in the history
* zeta_global_sspBidAdapter shortname was added

* remove the trash

Co-authored-by: Surovenko Alexey <surovenko.alexey@gmail.com>
  • Loading branch information
asurovenko-zeta and surovenko authored May 24, 2022
1 parent c434889 commit f11bcda
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 25 deletions.
2 changes: 1 addition & 1 deletion modules/zeta_global_sspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const spec = {
user: params.user ? params.user : {},
app: params.app ? params.app : {},
ext: {
tags: params.tags ? params.tags : {},
tags: {...params.tags, shortname: params.shortname},
sid: params.sid ? params.sid : undefined
}
};
Expand Down
61 changes: 37 additions & 24 deletions test/spec/modules/zeta_global_sspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ describe('Zeta Ssp Bid Adapter', function () {
}
];

const params = {
user: {
uid: 222,
buyeruid: 333
},
tags: {
someTag: 444,
},
sid: 'publisherId',
shortname: 'test_shortname',
site: {
page: 'testPage'
},
app: {
bundle: 'testBundle'
},
test: 1
};

const bannerRequest = [{
bidId: 12345,
auctionId: 67890,
Expand All @@ -41,18 +60,7 @@ describe('Zeta Ssp Bid Adapter', function () {
consentString: 'consentString'
},
uspConsent: 'someCCPAString',
params: {
placement: 111,
user: {
uid: 222,
buyeruid: 333
},
tags: {
someTag: 444,
sid: 'publisherId'
},
test: 1
},
params: params,
userIdAsEids: eids
}];

Expand All @@ -72,18 +80,7 @@ describe('Zeta Ssp Bid Adapter', function () {
refererInfo: {
referer: 'http://www.zetaglobal.com/page?param=video'
},
params: {
placement: 111,
user: {
uid: 222,
buyeruid: 333
},
tags: {
someTag: 444,
sid: 'publisherId'
},
test: 1
},
params: params
}];

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

expect(payload.imp[0].banner).to.be.undefined;
});

it('Test required params in banner request', function () {
const request = spec.buildRequests(bannerRequest, bannerRequest[0]);
const payload = JSON.parse(request.data);
expect(payload.ext.sid).to.eql('publisherId');
expect(payload.ext.tags.someTag).to.eql(444);
expect(payload.ext.tags.shortname).to.eql('test_shortname');
});

it('Test required params in video request', function () {
const request = spec.buildRequests(videoRequest, videoRequest[0]);
const payload = JSON.parse(request.data);
expect(payload.ext.sid).to.eql('publisherId');
expect(payload.ext.tags.someTag).to.eql(444);
expect(payload.ext.tags.shortname).to.eql('test_shortname');
});
});

0 comments on commit f11bcda

Please sign in to comment.