From e0f7df9d62b7197151f0f0c240554c46baad891b Mon Sep 17 00:00:00 2001 From: robertrmartinez Date: Thu, 21 Jan 2021 09:44:25 -0800 Subject: [PATCH] revert the wrapper details for testing --- modules/rubiconAnalyticsAdapter.js | 8 ++--- .../modules/rubiconAnalyticsAdapter_spec.js | 32 +------------------ 2 files changed, 3 insertions(+), 37 deletions(-) diff --git a/modules/rubiconAnalyticsAdapter.js b/modules/rubiconAnalyticsAdapter.js index af5228b8b92..a573436fb8b 100644 --- a/modules/rubiconAnalyticsAdapter.js +++ b/modules/rubiconAnalyticsAdapter.js @@ -162,17 +162,13 @@ function sendMessage(auctionId, bidWonId) { let message = { eventTimeMillis: Date.now(), integration: rubiConf.int_type || DEFAULT_INTEGRATION, + ruleId: rubiConf.rule_name, version: '$prebid.version$', referrerUri: referrer, referrerHostname: rubiconAdapter.referrerHostname || getHostNameFromReferer(referrer), channel: 'web', + wrapperName: rubiConf.wrapperName }; - if (rubiConf.wrapperName || rubiConf.rule_name) { - message.wrapper = { - name: rubiConf.wrapperName, - rule: rubiConf.rule_name - } - } if (auctionCache && !auctionCache.sent) { let adUnitMap = Object.keys(auctionCache.bids).reduce((adUnits, bidId) => { let bid = auctionCache.bids[bidId]; diff --git a/test/spec/modules/rubiconAnalyticsAdapter_spec.js b/test/spec/modules/rubiconAnalyticsAdapter_spec.js index 4bb2f6e217c..0c19d8dbadf 100644 --- a/test/spec/modules/rubiconAnalyticsAdapter_spec.js +++ b/test/spec/modules/rubiconAnalyticsAdapter_spec.js @@ -532,9 +532,7 @@ const ANALYTICS_MESSAGE = { 'bidwonStatus': 'success' } ], - 'wrapper': { - 'name': '10000_fakewrapper_test' - } + 'wrapperName': '10000_fakewrapper_test' }; function performStandardAuction(gptEvents) { @@ -1749,34 +1747,6 @@ describe('rubicon analytics adapter', function () { }); }); - describe('wrapper details passed in', () => { - it('should correctly pass in the wrapper details if provided', () => { - config.setConfig({rubicon: { - wrapperName: '1001_wrapperName', - rule_name: 'na-mobile' - }}); - - rubiconAnalyticsAdapter.enableAnalytics({ - options: { - endpoint: '//localhost:9999/event', - accountId: 1001 - } - }); - - performStandardAuction(); - - expect(server.requests.length).to.equal(1); - const request = server.requests[0]; - const message = JSON.parse(request.requestBody); - expect(message.wrapper).to.deep.equal({ - name: '1001_wrapperName', - rule: 'na-mobile' - }); - - rubiconAnalyticsAdapter.disableAnalytics(); - }); - }); - it('getHostNameFromReferer correctly grabs hostname from an input URL', function () { let inputUrl = 'https://www.prebid.org/some/path?pbjs_debug=true'; expect(getHostNameFromReferer(inputUrl)).to.equal('www.prebid.org');