Skip to content

Commit

Permalink
turn comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rmi22186 committed Oct 23, 2024
1 parent 59d0478 commit f3ce8b9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions rollup.test.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://go.mparticle.com/work/SQDSDKS-6875
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';

Expand Down
8 changes: 5 additions & 3 deletions src/BrazeKit-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,11 @@ var constructor = function () {
userConsentState
);

latestUserBrazeConsentString = JSON.stringify(currentConsentPayload);
if (!isEmpty(currentConsentPayload)) {
latestUserBrazeConsentString = JSON.stringify(
currentConsentPayload
);

if (latestUserBrazeConsentString.length) {
setConsentOnBraze(currentConsentPayload);
}
}
Expand All @@ -742,7 +744,7 @@ var constructor = function () {
}

function maybeSetConsentBeforeEventLogged(event) {
if (latestUserBrazeConsentString && parsedConsentMappings.length) {
if (latestUserBrazeConsentString && !isEmpty(parsedConsentMappings)) {
var eventConsentState = getEventConsentState(event.ConsentState);

if (!isEmpty(eventConsentState)) {
Expand Down
4 changes: 2 additions & 2 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1920,7 +1920,7 @@ user.getUserIdentities is not a function,\n`;
window.braze.user.customAttributeSet.should.equal(false);
});

it('user consent should not be updated if a customer does not change his consent before logging an event', function() {
it('should not update user consent if a customer does not change consent before logging an event', function() {
mParticle.forwarder.init({
apiKey: '123456',
userIdentificationType: 'MPID',
Expand Down Expand Up @@ -1968,7 +1968,7 @@ user.getUserIdentities is not a function,\n`;
window.braze.user.customAttributeSet.should.equal(false);
});

it('user consent should be updated if an event has a different consent than the previously set consent', function() {
it('should update user consent if an event has a different consent than the previously set consent', function() {
mParticle.forwarder.init({
apiKey: '123456',
userIdentificationType: 'MPID',
Expand Down

0 comments on commit f3ce8b9

Please sign in to comment.