diff --git a/modules/gumgumBidAdapter.js b/modules/gumgumBidAdapter.js index 46ea7c1b3907..d112c5a34036 100644 --- a/modules/gumgumBidAdapter.js +++ b/modules/gumgumBidAdapter.js @@ -224,7 +224,7 @@ function _getFloor (mediaTypes, staticBidFloor, bid) { function getEids (userId) { return Object.keys(userId).reduce(function (eids, provider) { - if (provider.id) eids[provider] = userId[provider].id; + if (userId[provider]) eids[provider] = userId[provider]; return eids; }, {}); } @@ -252,13 +252,12 @@ function buildRequests (validBidRequests, bidderRequest) { ortb2Imp } = bidRequest; const { currency, floor } = _getFloor(mediaTypes, params.bidfloor, bidRequest); - const eids = []; + const eids = getEids(userId); let sizes = [1, 1]; let data = {}; let gpid = ''; // ADTS-134 Fetch DIL Envelope for Client Side Header Bidding - eids.push.apply(eids, getEids(userId)); for (const eid in eids) data[eid] = eids[eid]; // ADJS-1024 diff --git a/test/spec/modules/gumgumBidAdapter_spec.js b/test/spec/modules/gumgumBidAdapter_spec.js index f1e789586654..6a7aba20b3a6 100644 --- a/test/spec/modules/gumgumBidAdapter_spec.js +++ b/test/spec/modules/gumgumBidAdapter_spec.js @@ -147,22 +147,6 @@ describe('gumgumAdapter', function () { const zoneParam = { 'zone': '123a' }; const pubIdParam = { 'pubId': 123 }; - it('should send IDL envelope ID if available', function () { - const idl_env = 'abc123'; - const request = { ...bidRequests[0], userId: { idl_env } }; - const bidRequest = spec.buildRequests([request])[0]; - - expect(bidRequest.data).to.have.property('idl_env'); - expect(bidRequest.data.idl_env).to.equal(idl_env); - }); - - it('should not send IDL envelope if not available', function () { - const request = { ...bidRequests[0] }; - const bidRequest = spec.buildRequests([request])[0]; - - expect(bidRequest.data).to.not.have.property('idl_env'); - }); - it('should set pubId param if found', function () { const request = { ...bidRequests[0], params: pubIdParam }; const bidRequest = spec.buildRequests([request])[0]; @@ -463,6 +447,21 @@ describe('gumgumAdapter', function () { const request = spec.buildRequests(bidRequests)[0]; expect(request.data).to.not.include.any.keys('tdid'); }); + it('should send IDL envelope ID if available', function () { + const idl_env = 'abc123'; + const request = { ...bidRequests[0], userId: { idl_env } }; + const bidRequest = spec.buildRequests([request])[0]; + + expect(bidRequest.data).to.have.property('idl_env'); + expect(bidRequest.data.idl_env).to.equal(idl_env); + }); + + it('should not send IDL envelope if not available', function () { + const request = { ...bidRequests[0] }; + const bidRequest = spec.buildRequests([request])[0]; + + expect(bidRequest.data).to.not.have.property('idl_env'); + }); it('should send schain parameter in serialized form', function () { const serializedForm = '1.0,1!exchange1.com,1234,1,bid-request-1,publisher,publisher.com!exchange2.com,abcd,1,bid-request-2,intermediary,intermediary.com' const request = spec.buildRequests(bidRequests)[0];