fix: Set mapped consent name from server to lowercase #47
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.
Instructions
development
Summary
While consent purposes can be inputted into the web sdk via any casing, the SDK will automatically lowercase them to prevent pseudo-duplicate consent purposes. In the UI, these have a capital first letter, and the server sends them back with a capital first letter also. To keep it all consistent, we should lowercase what comes back from the server.
I also added this comment in our onetrust kit so that future developers are aware - mparticle-integrations/mparticle-javascript-integration-onetrust@7546883#diff-105894ea1c74ee2f835325f6211da57e6a15a8236598d11a9ea6b0e7a8f29b47R87-R93
Testing Plan
Tested on local app. Updated unit tests. When updating the unit tests with a capital 1st letter, it fails a bunch of tests. Then when adding
toLowerCase
, tests run properly.Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)