Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rp adapter unit tests - userid mod support #5985

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions test/spec/modules/rubiconBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,43 @@ describe('the rubicon adapter', function () {
});
});

describe('ID5 support', function () {
it('should send ID5 id when userIdAsEids contains ID5', function () {
const clonedBid = utils.deepClone(bidderRequest.bids[0]);
clonedBid.userId = {
id5id: {
uid: '11111',
ext: {
linkType: '22222'
}
}
};
clonedBid.userIdAsEids = createEidsArray(clonedBid.userId);
let [request] = spec.buildRequests([clonedBid], bidderRequest);
let data = parseQuery(request.data);

expect(data['eid_id5-sync.com']).to.equal('11111^1^22222');
});
});

describe('UserID catchall support', function () {
it('should send user id with generic format', function () {
const clonedBid = utils.deepClone(bidderRequest.bids[0]);
// Hardcoding userIdAsEids since createEidsArray returns empty array if source not found in eids.js
clonedBid.userIdAsEids = [{
source: 'catchall',
uids: [{
id: '11111',
atype: 2
}]
}]
let [request] = spec.buildRequests([clonedBid], bidderRequest);
let data = parseQuery(request.data);

expect(data['eid_catchall']).to.equal('11111^2');
});
});

describe('Config user.id support', function () {
it('should send ppuid when config defines user.id', function () {
config.setConfig({user: {id: '123'}});
Expand Down