From 7f0732f619e5c969f7749c995e2cf9f3d2bb94f6 Mon Sep 17 00:00:00 2001 From: SebRobert Date: Thu, 1 Feb 2024 14:39:45 +0100 Subject: [PATCH] BeOp Bid Adapter: add eids support (#11025) * BeOp Bid Adapter: Add eids support (#14) * Fix tests --- modules/beopBidAdapter.js | 2 ++ test/spec/modules/beopBidAdapter_spec.js | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/modules/beopBidAdapter.js b/modules/beopBidAdapter.js index ad52af824ee..89289654b32 100644 --- a/modules/beopBidAdapter.js +++ b/modules/beopBidAdapter.js @@ -72,6 +72,7 @@ export const spec = { is_amp: deepAccess(bidderRequest, 'referrerInfo.isAmp'), gdpr_applies: gdpr ? gdpr.gdprApplies : false, tc_string: (gdpr && gdpr.gdprApplies) ? gdpr.consentString : null, + eids: firstSlot.eids, }; const payloadString = JSON.stringify(payloadObject); @@ -159,6 +160,7 @@ function beOpRequestSlotsMaker(bid) { brc: getBidIdParameter('bidRequestsCount', bid), bdrc: getBidIdParameter('bidderRequestCount', bid), bwc: getBidIdParameter('bidderWinsCount', bid), + eids: bid.userIdAsEids, } } diff --git a/test/spec/modules/beopBidAdapter_spec.js b/test/spec/modules/beopBidAdapter_spec.js index c77e304e539..663d622e505 100644 --- a/test/spec/modules/beopBidAdapter_spec.js +++ b/test/spec/modules/beopBidAdapter_spec.js @@ -312,4 +312,22 @@ describe('BeOp Bid Adapter tests', () => { expect(payload.kwds).to.include('keywords'); }) }) + + describe('Ensure eids are get', function() { + let bidRequests = []; + afterEach(function () { + bidRequests = []; + }); + + it(`should get eids from bid`, function () { + let bid = Object.assign({}, validBid); + bid.userIdAsEids = [{source: 'provider.com', uids: [{id: 'someid', atype: 1, ext: {whatever: true}}]}]; + bidRequests.push(bid); + + const request = spec.buildRequests(bidRequests, {}); + const payload = JSON.parse(request.data); + expect(payload.eids).to.exist; + expect(payload.eids[0].source).to.equal('provider.com'); + }); + }) });