Skip to content

Commit

Permalink
IX Bid Adapter - Add support for IMUID (prebid#9500)
Browse files Browse the repository at this point in the history
* feat: add imuid to pbjs adapter [PB-1434]

* chore: add unit test [PB-1434]

---------

Co-authored-by: Chris Corbo <chris.corbo@indexexchange.com>
  • Loading branch information
ccorbo and Chris Corbo authored Feb 8, 2023
1 parent 7e41def commit cd829a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion modules/ixBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ const SOURCE_RTI_MAPPING = {
'epsilon.com': '', // Publisher Link, publinkId
'audigent.com': '', // Hadron ID from Audigent, hadronId
'pubcid.org': '', // SharedID, pubcid
'trustpid.com': '' // Trustpid
'trustpid.com': '', // Trustpid
'intimatemerger.com': ''
};
const PROVIDERS = [
'britepoolid',
Expand Down
17 changes: 11 additions & 6 deletions test/spec/modules/ixBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,8 @@ describe('IndexexchangeAdapter', function () {
// so structured because when calling createEidsArray, UID2's getValue func takes .id to set in uids
uid2: { id: 'testuid2' }, // UID 2.0
// similar to uid2, but id5's getValue takes .uid
id5id: { uid: 'testid5id' } // ID5
id5id: { uid: 'testid5id' }, // ID5
imuid: 'testimuid'
};

const DEFAULT_USERIDASEIDS_DATA = createEidsArray(DEFAULT_USERID_DATA);
Expand Down Expand Up @@ -801,6 +802,11 @@ describe('IndexexchangeAdapter', function () {
uids: [{
id: DEFAULT_USERID_DATA.id5id.uid
}]
}, {
source: 'intimatemerger.com',
uids: [{
id: DEFAULT_USERID_DATA.imuid,
}]
}
];

Expand Down Expand Up @@ -1193,7 +1199,7 @@ describe('IndexexchangeAdapter', function () {
const payload = extractPayload(request[0]);
expect(request).to.be.an('array');
expect(request).to.have.lengthOf.above(0); // should be 1 or more
expect(payload.user.eids).to.have.lengthOf(6);
expect(payload.user.eids).to.have.lengthOf(7);
expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[0]);
});
});
Expand Down Expand Up @@ -1381,8 +1387,7 @@ describe('IndexexchangeAdapter', function () {
cloneValidBid[0].userIdAsEids = utils.deepClone(DEFAULT_USERIDASEIDS_DATA);
const request = spec.buildRequests(cloneValidBid, DEFAULT_OPTION)[0];
const payload = extractPayload(request);

expect(payload.user.eids).to.have.lengthOf(6);
expect(payload.user.eids).to.have.lengthOf(7);
expect(payload.user.eids).to.have.deep.members(DEFAULT_USERID_PAYLOAD);
});

Expand Down Expand Up @@ -1515,7 +1520,7 @@ describe('IndexexchangeAdapter', function () {
})

expect(payload.user).to.exist;
expect(payload.user.eids).to.have.lengthOf(8);
expect(payload.user.eids).to.have.lengthOf(9);

expect(payload.user.eids).to.have.deep.members(validUserIdPayload);
});
Expand Down Expand Up @@ -1557,7 +1562,7 @@ describe('IndexexchangeAdapter', function () {
});

const payload = extractPayload(request);
expect(payload.user.eids).to.have.lengthOf(7);
expect(payload.user.eids).to.have.lengthOf(8);
expect(payload.user.eids).to.have.deep.members(validUserIdPayload);
});
});
Expand Down

0 comments on commit cd829a5

Please sign in to comment.