Skip to content

Commit 3342882

Browse files
Test assertion
1 parent fe0f353 commit 3342882

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/storages/inLocalStorage/__tests__/SplitsCacheInLocal.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ test('SPLITS CACHE / LocalStorage / flag set cache tests', () => {
173173
], [], -1);
174174
cache.addSplit(featureFlagWithEmptyFS);
175175

176+
// Adding an existing FF should not affect the cache
177+
cache.update([featureFlagTwo], [], -1);
178+
176179
expect(cache.getNamesByFlagSets(['o'])).toEqual([new Set(['ff_one', 'ff_two'])]);
177180
expect(cache.getNamesByFlagSets(['n'])).toEqual([new Set(['ff_one'])]);
178181
expect(cache.getNamesByFlagSets(['e'])).toEqual([new Set(['ff_one', 'ff_three'])]);

src/storages/inMemory/__tests__/SplitsCacheInMemory.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ test('SPLITS CACHE / In Memory / flag set cache tests', () => {
135135
], [], -1);
136136
cache.addSplit(featureFlagWithEmptyFS);
137137

138+
// Adding an existing FF should not affect the cache
139+
cache.update([featureFlagTwo], [], -1);
140+
138141
expect(cache.getNamesByFlagSets(['o'])).toEqual([new Set(['ff_one', 'ff_two'])]);
139142
expect(cache.getNamesByFlagSets(['n'])).toEqual([new Set(['ff_one'])]);
140143
expect(cache.getNamesByFlagSets(['e'])).toEqual([new Set(['ff_one', 'ff_three'])]);

0 commit comments

Comments
 (0)