-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Allow any userIdentificationType to be used when initializing kit #48
Merged
rmi22186
merged 6 commits into
master-v4
from
fix/SQDSDKS-6345-identify-with-any-user-type
May 3, 2024
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0e9c191
fix: Allow any userIdentificationType to be used when initializing kit
rmi22186 90e0d9f
Add test
rmi22186 edc7067
Rephrase test
rmi22186 dd4c425
Add case for when brazeUserIDType is null/undefined
rmi22186 34dbadb
Update src/BrazeKit-dev.js
rmi22186 7883f30
Check for null currentuser
rmi22186 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -254,6 +254,7 @@ describe('Braze Forwarder', function() { | |
return { | ||
userIdentities: { | ||
customerid: 'abc', | ||
email: '[email protected]' | ||
}, | ||
}; | ||
}, | ||
|
@@ -970,6 +971,25 @@ describe('Braze Forwarder', function() { | |
delete mParticle.getVersion; | ||
}); | ||
|
||
it('should set an identity on the user upon kit initialization when userIdentificationType is email', function() { | ||
mParticle.forwarder.init({ | ||
apiKey: '123456', | ||
userIdentificationType: 'Email', | ||
}); | ||
|
||
window.braze.userId.should.equal('[email protected]'); | ||
window.braze.getUser().emailSet.should.equal('[email protected]'); | ||
}); | ||
|
||
it('should not attempt to set an identity on braze if the userIdentificationType does not exist on the customer', function() { | ||
mParticle.forwarder.init({ | ||
apiKey: '123456', | ||
userIdentificationType: 'other2', | ||
}); | ||
|
||
Should(window.braze.userId).equal(null); | ||
}); | ||
|
||
it('should set main braze user identity from userIdentificationType ', function() { | ||
mParticle.forwarder.init({ | ||
apiKey: '123456', | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're no longer referencing
forwarderSettings
, we should remove it from the function parameters.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is still being passed to
openSession
at the bottom of this functionThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooof. Missed that.