From 26380c1966d337e204a7988361e8782e46c8006b Mon Sep 17 00:00:00 2001 From: jxdeveloper1 <71084096+jxdeveloper1@users.noreply.github.com> Date: Sat, 21 May 2022 01:05:40 +0800 Subject: [PATCH] Jixie Bid Adapter: add schain (#8439) * Adapter does not seem capable of supporting advertiserDomains #6650 added response comment and some trivial code. * removed a blank line at the end of file added a space behind the // in comments * in response to comment from reviewer. add the aspect of advertiserdomain in unit tests * added the code to get the keywords from the meta tags if available. * jixie sending schain info to jixie backend * support of schain info sent to jixie endpoint, fixing some indentation complaints from auto build check --- modules/jixieBidAdapter.js | 2 ++ test/spec/modules/jixieBidAdapter_spec.js | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/modules/jixieBidAdapter.js b/modules/jixieBidAdapter.js index 90ea17395f76..fb55add910f9 100644 --- a/modules/jixieBidAdapter.js +++ b/modules/jixieBidAdapter.js @@ -184,6 +184,7 @@ export const spec = { let ids = fetchIds_(); let eids = []; let miscDims = internal.getMiscDims(); + let schain = deepAccess(validBidRequests[0], 'schain'); // all available user ids are sent to our backend in the standard array layout: if (validBidRequests[0].userId) { @@ -209,6 +210,7 @@ export const spec = { mkeywords: miscDims.mkeywords, bids: bids, eids: eids, + schain: schain, pricegranularity: pg, cfg: jixieCfgBlob }, ids); diff --git a/test/spec/modules/jixieBidAdapter_spec.js b/test/spec/modules/jixieBidAdapter_spec.js index 0a6ba2729702..bc44e5948649 100644 --- a/test/spec/modules/jixieBidAdapter_spec.js +++ b/test/spec/modules/jixieBidAdapter_spec.js @@ -285,6 +285,23 @@ describe('jixie Adapter', function () { expect(payload.device).to.deep.include(content); }); + it('schain info should be accessible when available', function () { + const schain = { + ver: '1.0', + complete: 1, + nodes: [{ + asi: 'ssp.test', + sid: '00001', + hp: 1 + }] + }; + const oneSpecialBidReq = Object.assign({}, bidRequests_[0], { schain: schain }); + const request = spec.buildRequests([oneSpecialBidReq], bidderRequest_); + const payload = JSON.parse(request.data); + expect(payload.schain).to.deep.equal(schain); + expect(payload.schain).to.deep.include(schain); + }); + it('should populate eids when supported userIds are available', function () { const oneSpecialBidReq = Object.assign({}, bidRequests_[0], { userId: {