-
Notifications
You must be signed in to change notification settings - Fork 58
feat: disable product cookie when no targeting is true #1071
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
Closed
jaissica12
wants to merge
11
commits into
feat/SDKE-91-disable-session-cookie-localStorage-when-noFunctional-is-set
from
feat/SDKE-92-disable-product-cookie-when-noTargeting-is-true
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b7230d6
feat: disable product cookie when persistence is set and updated test
jaissica12 b14099e
test: added jest tests and updated test content
jaissica12 bbe4f08
Merge remote-tracking branch 'origin/development' into feat/SDKE-92-d…
jaissica12 507b3e5
refactor: updated getPrivacyFlag in persistence and updated test content
jaissica12 9f062ca
test: updated jest test for persistence
jaissica12 d09d4c9
test: updated jest test for persistence failure
jaissica12 273e170
Merge remote-tracking branch 'origin/development' into feat/SDKE-92-d…
jaissica12 0847f1e
test: source privacy flag from launcherOptions
jaissica12 bfcdb2b
test: move/rename test to persistence.products.spec
jaissica12 6c0c0c8
chore: removed redundant if block
jaissica12 95d8fd8
test: updated products persistence test
jaissica12 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import { | ||
| mParticle, | ||
| MPConfig, | ||
| testMPID, | ||
| } from '../src/config/constants'; | ||
| import { Product } from '@mparticle/web-sdk'; | ||
|
|
||
| describe('Products Persistence', () => { | ||
| let mpInstance = mParticle.getInstance(); | ||
| beforeEach(() => { | ||
| mParticle._resetForTests(MPConfig); | ||
| mpInstance._Persistence.resetPersistence(); | ||
| }); | ||
|
|
||
| it('should save products to localStorage when noTargeting is false by default', () => { | ||
| const product: Partial<Product> = { Name: 'iphone', Sku: 'iphonesku', Price: 599, Quantity: 1 }; | ||
| mpInstance._Persistence.setCartProducts({ [testMPID]: { cp: [product] } } as unknown as Product[]); | ||
| expect(mpInstance._Persistence.getCartProducts(testMPID).length).toBe(1); | ||
| }); | ||
|
|
||
| it('should NOT save products to localStorage when noTargeting is true', () => { | ||
| mpInstance._Store.setNoTargeting(true); | ||
| const product: Partial<Product> = { Name: 'iphone', Sku: 'iphonesku', Price: 599, Quantity: 1 }; | ||
| mpInstance._Persistence.setCartProducts({ [testMPID]: { cp: [product] } } as unknown as Product[]); | ||
| expect(mpInstance._Persistence.getCartProducts(testMPID).length).toBe(0); | ||
| }); | ||
|
|
||
| it('should save products to localStorage when noTargeting is false', () => { | ||
| mpInstance._Store.setNoTargeting(false); | ||
| const product: Partial<Product> = { Name: 'iphone', Sku: 'iphonesku', Price: 599, Quantity: 1 }; | ||
| mpInstance._Persistence.setCartProducts({ [testMPID]: { cp: [product] } } as unknown as Product[]); | ||
| expect(mpInstance._Persistence.getCartProducts(testMPID).length).toBe(1); | ||
| }); | ||
| }); |
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.