From de03c5ca5b3fb10cdcde970bb1dad89b389e279f Mon Sep 17 00:00:00 2001 From: Nicholas Llerandi Date: Thu, 12 Nov 2020 15:27:42 -0500 Subject: [PATCH 1/5] ID5 support --- .eslintrc.js | 2 +- test/spec/modules/rubiconBidAdapter_spec.js | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index c64ab379c52..d8ceb8db59d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -39,7 +39,7 @@ module.exports = { "no-throw-literal": "off", "no-undef": 2, "no-useless-escape": "off", - "no-console": "error" + "no-console": "off" }, "overrides": Object.keys(allowedModules).map((key) => ({ "files": key + "/**/*.js", diff --git a/test/spec/modules/rubiconBidAdapter_spec.js b/test/spec/modules/rubiconBidAdapter_spec.js index 6659c281c33..14cc687b482 100644 --- a/test/spec/modules/rubiconBidAdapter_spec.js +++ b/test/spec/modules/rubiconBidAdapter_spec.js @@ -1221,6 +1221,23 @@ 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' + } + }; + clonedBid.userIdAsEids = createEidsArray(clonedBid.userId); + console.log(clonedBid.userIdAsEids) + let [request] = spec.buildRequests([clonedBid], bidderRequest); + let data = parseQuery(request.data); + + expect(data['eid_id5-sync.com']).to.equal('11111^1^'); + }); + }); + describe('Config user.id support', function () { it('should send ppuid when config defines user.id', function () { config.setConfig({user: {id: '123'}}); From 698852fa58ab2057ad9514241bb5c2f6dece5a49 Mon Sep 17 00:00:00 2001 From: Nicholas Llerandi Date: Thu, 12 Nov 2020 15:54:42 -0500 Subject: [PATCH 2/5] ID5 support; tests passed --- test/spec/modules/rubiconBidAdapter_spec.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/spec/modules/rubiconBidAdapter_spec.js b/test/spec/modules/rubiconBidAdapter_spec.js index 14cc687b482..21c26268730 100644 --- a/test/spec/modules/rubiconBidAdapter_spec.js +++ b/test/spec/modules/rubiconBidAdapter_spec.js @@ -1226,15 +1226,17 @@ describe('the rubicon adapter', function () { const clonedBid = utils.deepClone(bidderRequest.bids[0]); clonedBid.userId = { id5id: { - uid: '11111' + uid: '11111', + ext: { + linkType: '22222' + } } }; clonedBid.userIdAsEids = createEidsArray(clonedBid.userId); - console.log(clonedBid.userIdAsEids) let [request] = spec.buildRequests([clonedBid], bidderRequest); let data = parseQuery(request.data); - expect(data['eid_id5-sync.com']).to.equal('11111^1^'); + expect(data['eid_id5-sync.com']).to.equal('11111^1^22222'); }); }); From 2e25b2f8d7b9e42a1aeae6080ec66b0d344e651e Mon Sep 17 00:00:00 2001 From: Nicholas Llerandi Date: Thu, 12 Nov 2020 16:00:20 -0500 Subject: [PATCH 3/5] no-console:error --- .eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index d8ceb8db59d..c64ab379c52 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -39,7 +39,7 @@ module.exports = { "no-throw-literal": "off", "no-undef": 2, "no-useless-escape": "off", - "no-console": "off" + "no-console": "error" }, "overrides": Object.keys(allowedModules).map((key) => ({ "files": key + "/**/*.js", From 72691c5fba415f931a31f1a4397115808ae58221 Mon Sep 17 00:00:00 2001 From: Nicholas Llerandi Date: Fri, 13 Nov 2020 10:28:26 -0500 Subject: [PATCH 4/5] UserId catchall support --- test/spec/modules/rubiconBidAdapter_spec.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/spec/modules/rubiconBidAdapter_spec.js b/test/spec/modules/rubiconBidAdapter_spec.js index 21c26268730..ed82d2eb750 100644 --- a/test/spec/modules/rubiconBidAdapter_spec.js +++ b/test/spec/modules/rubiconBidAdapter_spec.js @@ -1240,6 +1240,24 @@ describe('the rubicon adapter', function () { }); }); + 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'}}); From ac1dfc3ee7e0be1ca0db1963631b4419f5099c82 Mon Sep 17 00:00:00 2001 From: Nicholas Llerandi Date: Tue, 17 Nov 2020 13:18:38 -0500 Subject: [PATCH 5/5] minor revision --- test/spec/modules/rubiconBidAdapter_spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/spec/modules/rubiconBidAdapter_spec.js b/test/spec/modules/rubiconBidAdapter_spec.js index ed82d2eb750..b1ef02a6369 100644 --- a/test/spec/modules/rubiconBidAdapter_spec.js +++ b/test/spec/modules/rubiconBidAdapter_spec.js @@ -1245,9 +1245,9 @@ describe('the rubicon adapter', 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", + source: 'catchall', uids: [{ - id: "11111", + id: '11111', atype: 2 }] }]