Skip to content

Commit dd1c4b4

Browse files
committed
chore: updated test content
1 parent bfbb1de commit dd1c4b4

3 files changed

Lines changed: 11 additions & 12 deletions

File tree

src/persistence.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ export default function _Persistence(mpInstance) {
332332
return parsedDecodedProducts;
333333
};
334334

335-
// Update only the product storage, independent from main persistence writes
336335
this.setProductStorage = function() {
337336
if (!mpInstance._Store.isLocalStorageAvailable) {
338337
return;

test/jest/persistence.spec.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Store, { IStore } from '../../src/store';
22
import { IMParticleWebSDKInstance } from '../../src/mp-instance';
33
import { SDKInitConfig } from '../../src/sdkRuntimeModels';
44

5-
describe('Persistence writers', () => {
5+
describe('Persistence store', () => {
66
let store: IStore;
77
let mockMPInstance: IMParticleWebSDKInstance;
88

@@ -49,14 +49,14 @@ describe('Persistence writers', () => {
4949
Store.call(store, {} as SDKInitConfig, mockMPInstance, 'apikey');
5050
});
5151

52-
describe('#noFunctional', () => {
52+
describe('#noFunctional privacy flag', () => {
5353
describe('true', () => {
5454
beforeEach(() => {
5555
store.setNoFunctional(true);
5656
store.webviewBridgeEnabled = false;
5757
});
5858

59-
it('should NOT write to cookie when useCookieStorage = true', () => {
59+
it('should NOT write to cookie when useCookieStorage is true', () => {
6060
store.SDKConfig.useCookieStorage = true;
6161
jest.clearAllMocks();
6262

@@ -67,7 +67,7 @@ describe('Persistence writers', () => {
6767
expect(mockMPInstance._Persistence.setProductStorage).toHaveBeenCalled();
6868
});
6969

70-
it('should NOT write to localStorage when useCookieStorage = false', () => {
70+
it('should NOT write to localStorage when useCookieStorage is false', () => {
7171
store.SDKConfig.useCookieStorage = false;
7272
jest.clearAllMocks();
7373

@@ -85,7 +85,7 @@ describe('Persistence writers', () => {
8585
store.webviewBridgeEnabled = false;
8686
});
8787

88-
it('should write to cookie when useCookieStorage = true', () => {
88+
it('should write to cookie when useCookieStorage is true', () => {
8989
store.SDKConfig.useCookieStorage = true;
9090
jest.clearAllMocks();
9191

@@ -96,7 +96,7 @@ describe('Persistence writers', () => {
9696
expect(mockMPInstance._Persistence.setProductStorage).not.toHaveBeenCalled();
9797
});
9898

99-
it('should write to localStorage when useCookieStorage = false', () => {
99+
it('should write to localStorage when useCookieStorage is false', () => {
100100
store.SDKConfig.useCookieStorage = false;
101101
jest.clearAllMocks();
102102

@@ -108,13 +108,13 @@ describe('Persistence writers', () => {
108108
});
109109
});
110110

111-
describe('default (false)', () => {
111+
describe('is false by default', () => {
112112
beforeEach(() => {
113113
// default is false
114114
store.webviewBridgeEnabled = false;
115115
});
116116

117-
it('should write to cookie by default when useCookieStorage = true', () => {
117+
it('should write to cookie by default when useCookieStorage is true', () => {
118118
store.SDKConfig.useCookieStorage = true;
119119
jest.clearAllMocks();
120120

@@ -126,7 +126,7 @@ describe('Persistence writers', () => {
126126
expect(mockMPInstance._Persistence.setProductStorage).not.toHaveBeenCalled();
127127
});
128128

129-
it('should write to localStorage by default when useCookieStorage = false', () => {
129+
it('should write to localStorage by default when useCookieStorage is false', () => {
130130
store.SDKConfig.useCookieStorage = false;
131131
jest.clearAllMocks();
132132

@@ -139,7 +139,7 @@ describe('Persistence writers', () => {
139139
});
140140
});
141141

142-
it('should NOT write to storage when webviewBridgeEnabled = true', () => {
142+
it('should NOT write to storage when webviewBridgeEnabled is true', () => {
143143
store.setNoFunctional(false);
144144
store.webviewBridgeEnabled = true;
145145
store.SDKConfig.useCookieStorage = true;

test/src/tests-persistence.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,7 @@ describe('persistence', () => {
20242024
});
20252025
});
20262026

2027-
describe('default (false)', () => {
2027+
describe('is false by default', () => {
20282028
it('should store cookie when useCookieStorage = true', async () => {
20292029
mParticle.config.useCookieStorage = true;
20302030

0 commit comments

Comments
 (0)