From f11bcdaa0695662e13faee53520ae176fbb0ee29 Mon Sep 17 00:00:00 2001 From: asurovenko-zeta <80847074+asurovenko-zeta@users.noreply.github.com> Date: Tue, 24 May 2022 20:51:05 +0700 Subject: [PATCH] Zeta global ssp bid adapter: add shortname param (#8454) * zeta_global_sspBidAdapter shortname was added * remove the trash Co-authored-by: Surovenko Alexey --- modules/zeta_global_sspBidAdapter.js | 2 +- .../modules/zeta_global_sspBidAdapter_spec.js | 61 +++++++++++-------- 2 files changed, 38 insertions(+), 25 deletions(-) diff --git a/modules/zeta_global_sspBidAdapter.js b/modules/zeta_global_sspBidAdapter.js index 87fdbe1396f..1fdd1eff179 100644 --- a/modules/zeta_global_sspBidAdapter.js +++ b/modules/zeta_global_sspBidAdapter.js @@ -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 } }; diff --git a/test/spec/modules/zeta_global_sspBidAdapter_spec.js b/test/spec/modules/zeta_global_sspBidAdapter_spec.js index 20113a63994..f6faa67f6b8 100644 --- a/test/spec/modules/zeta_global_sspBidAdapter_spec.js +++ b/test/spec/modules/zeta_global_sspBidAdapter_spec.js @@ -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, @@ -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 }]; @@ -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 () { @@ -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'); + }); });