Skip to content

Commit

Permalink
remove usp consent string invalid test
Browse files Browse the repository at this point in the history
Ticket: IDG-677
  • Loading branch information
mscottnelson authored and carlosfelix committed May 17, 2023
1 parent 999c2ed commit f4c0334
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
13 changes: 4 additions & 9 deletions modules/33acrossAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,6 @@ function enableAnalyticsWrapper(config) {
auctions: {},
};

const usPrivacy = uspDataHandler.getConsentData();
if (/^1[Y|N|-]{3}$/.test(usPrivacy)) {
locals.cache.usPrivacy = usPrivacy;
}

analyticsAdapter.originEnableAnalytics(config);
}

Expand Down Expand Up @@ -292,7 +287,7 @@ export default analyticsAdapter;
* @return {AnalyticsReport} Analytics report
*/
function createReportFromCache(analyticsCache, completedAuctionId) {
const { pid, auctions, usPrivacy } = analyticsCache;
const { pid, auctions } = analyticsCache;

const report = {
pid,
Expand All @@ -301,8 +296,8 @@ function createReportFromCache(analyticsCache, completedAuctionId) {
pbjsVersion: '$prebid.version$', // Replaced by build script
auctions: [ auctions[completedAuctionId] ],
}
if (usPrivacy) {
report.usPrivacy = usPrivacy;
if (uspDataHandler.getConsentData()) {
report.usPrivacy = uspDataHandler.getConsentData();
}

return report;
Expand Down Expand Up @@ -471,7 +466,7 @@ function sendReport(report, endpoint) {
}

/**
* Encapsute certain logger functions and add a prefix to the final messages.
* Encapsulate certain logger functions and add a prefix to the final messages.
*
* @return {Object} New logger functions
*/
Expand Down
17 changes: 0 additions & 17 deletions test/spec/modules/33acrossAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,23 +205,6 @@ describe('33acrossAnalyticsAdapter:', function () {
});
});
});

context('and an *invalid* US Privacy configuration is present', function () {
['2ABC', '1234', '1YNYN', '11YNY'].forEach(consent => {
it('it calls "sendBeacon" without the usPrivacy field', function () {
sandbox.stub(uspDataHandler, 'getConsentData').returns(consent);
this.enableAnalytics();

navigator.sendBeacon
.withArgs('http://test-endpoint', createReportWithThreeBidWonEvents());

performStandardAuction();
sandbox.clock.tick(this.defaultTimeout + 1);

assert.calledOnceWithStringJsonEquivalent(navigator.sendBeacon, 'http://test-endpoint', createReportWithThreeBidWonEvents());
});
});
});
});

context('when an error occurs while sending the AnalyticsReport', function () {
Expand Down

0 comments on commit f4c0334

Please sign in to comment.