Skip to content

Commit

Permalink
revert the wrapper details for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
robertrmartinez committed Jan 21, 2021
1 parent 0eedc84 commit e0f7df9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 37 deletions.
8 changes: 2 additions & 6 deletions modules/rubiconAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
32 changes: 1 addition & 31 deletions test/spec/modules/rubiconAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,7 @@ const ANALYTICS_MESSAGE = {
'bidwonStatus': 'success'
}
],
'wrapper': {
'name': '10000_fakewrapper_test'
}
'wrapperName': '10000_fakewrapper_test'
};

function performStandardAuction(gptEvents) {
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit e0f7df9

Please sign in to comment.