Skip to content

Commit

Permalink
BeOp Bid Adapter: add eids support (prebid#11025)
Browse files Browse the repository at this point in the history
* BeOp Bid Adapter: Add eids support (#14)

* Fix tests
  • Loading branch information
sebrobert committed Feb 1, 2024
1 parent 0ad3244 commit 7f0732f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/beopBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -159,6 +160,7 @@ function beOpRequestSlotsMaker(bid) {
brc: getBidIdParameter('bidRequestsCount', bid),
bdrc: getBidIdParameter('bidderRequestCount', bid),
bwc: getBidIdParameter('bidderWinsCount', bid),
eids: bid.userIdAsEids,
}
}

Expand Down
18 changes: 18 additions & 0 deletions test/spec/modules/beopBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
})
});

0 comments on commit 7f0732f

Please sign in to comment.