Skip to content

Commit e0f7df9

Browse files
committedJan 21, 2021
revert the wrapper details for testing
1 parent 0eedc84 commit e0f7df9

File tree

2 files changed

+3
-37
lines changed

2 files changed

+3
-37
lines changed
 

‎modules/rubiconAnalyticsAdapter.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,13 @@ function sendMessage(auctionId, bidWonId) {
162162
let message = {
163163
eventTimeMillis: Date.now(),
164164
integration: rubiConf.int_type || DEFAULT_INTEGRATION,
165+
ruleId: rubiConf.rule_name,
165166
version: '$prebid.version$',
166167
referrerUri: referrer,
167168
referrerHostname: rubiconAdapter.referrerHostname || getHostNameFromReferer(referrer),
168169
channel: 'web',
170+
wrapperName: rubiConf.wrapperName
169171
};
170-
if (rubiConf.wrapperName || rubiConf.rule_name) {
171-
message.wrapper = {
172-
name: rubiConf.wrapperName,
173-
rule: rubiConf.rule_name
174-
}
175-
}
176172
if (auctionCache && !auctionCache.sent) {
177173
let adUnitMap = Object.keys(auctionCache.bids).reduce((adUnits, bidId) => {
178174
let bid = auctionCache.bids[bidId];

‎test/spec/modules/rubiconAnalyticsAdapter_spec.js

+1-31
Original file line numberDiff line numberDiff line change
@@ -532,9 +532,7 @@ const ANALYTICS_MESSAGE = {
532532
'bidwonStatus': 'success'
533533
}
534534
],
535-
'wrapper': {
536-
'name': '10000_fakewrapper_test'
537-
}
535+
'wrapperName': '10000_fakewrapper_test'
538536
};
539537

540538
function performStandardAuction(gptEvents) {
@@ -1749,34 +1747,6 @@ describe('rubicon analytics adapter', function () {
17491747
});
17501748
});
17511749

1752-
describe('wrapper details passed in', () => {
1753-
it('should correctly pass in the wrapper details if provided', () => {
1754-
config.setConfig({rubicon: {
1755-
wrapperName: '1001_wrapperName',
1756-
rule_name: 'na-mobile'
1757-
}});
1758-
1759-
rubiconAnalyticsAdapter.enableAnalytics({
1760-
options: {
1761-
endpoint: '//localhost:9999/event',
1762-
accountId: 1001
1763-
}
1764-
});
1765-
1766-
performStandardAuction();
1767-
1768-
expect(server.requests.length).to.equal(1);
1769-
const request = server.requests[0];
1770-
const message = JSON.parse(request.requestBody);
1771-
expect(message.wrapper).to.deep.equal({
1772-
name: '1001_wrapperName',
1773-
rule: 'na-mobile'
1774-
});
1775-
1776-
rubiconAnalyticsAdapter.disableAnalytics();
1777-
});
1778-
});
1779-
17801750
it('getHostNameFromReferer correctly grabs hostname from an input URL', function () {
17811751
let inputUrl = 'https://www.prebid.org/some/path?pbjs_debug=true';
17821752
expect(getHostNameFromReferer(inputUrl)).to.equal('www.prebid.org');

0 commit comments

Comments
 (0)
Failed to load comments.