Skip to content

Commit 3ba3b7d

Browse files
[FSSDK-13110] name update to tests
1 parent 1ae6fef commit 3ba3b7d

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎lib/project_config/polling_datafile_manager.spec.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ describe('PollingDatafileManager', () => {
106106
const repeater = getMockRepeater();
107107
const requestHandler = getMockRequestHandler(); // response promise is pending
108108
const cache = getMockAsyncCache<string>();
109-
await cache.set('opt-datafile-v6-keyThatExists', JSON.stringify({ name: 'keyThatExists' }));
109+
await cache.set('optimizely-datafile-keyThatExists', JSON.stringify({ name: 'keyThatExists' }));
110110

111111
const manager = new PollingDatafileManager({
112112
repeater,
@@ -131,7 +131,7 @@ describe('PollingDatafileManager', () => {
131131
requestHandler.makeRequest.mockReturnValueOnce(mockResponse);
132132

133133
const cache = getMockAsyncCache<string>();
134-
await cache.set('opt-datafile-v6-keyThatExists', JSON.stringify({ name: 'keyThatExists' }));
134+
await cache.set('optimizely-datafile-keyThatExists', JSON.stringify({ name: 'keyThatExists' }));
135135

136136
const manager = new PollingDatafileManager({
137137
repeater,
@@ -155,7 +155,7 @@ describe('PollingDatafileManager', () => {
155155
const repeater = getMockRepeater();
156156
const requestHandler = getMockRequestHandler();
157157
const cache = getMockAsyncCache<string>();
158-
await cache.set('opt-datafile-v6-keyThatExists', JSON.stringify({ name: 'keyThatExists' }));
158+
await cache.set('optimizely-datafile-keyThatExists', JSON.stringify({ name: 'keyThatExists' }));
159159
const mockResponse = getMockAbortableRequest();
160160
requestHandler.makeRequest.mockReturnValueOnce(mockResponse);
161161

@@ -564,7 +564,7 @@ describe('PollingDatafileManager', () => {
564564
repeater.execute(0);
565565

566566
await expect(manager.onRunning()).resolves.not.toThrow();
567-
expect(spy).toHaveBeenCalledWith('opt-datafile-v6-keyThatDoesNotExists', '{"foo": "bar"}');
567+
expect(spy).toHaveBeenCalledWith('optimizely-datafile-keyThatDoesNotExists', '{"foo": "bar"}');
568568
});
569569
});
570570

@@ -635,9 +635,9 @@ describe('PollingDatafileManager', () => {
635635
}
636636

637637
await expect(manager.onRunning()).resolves.not.toThrow();
638-
expect(spy).toHaveBeenNthCalledWith(1, 'opt-datafile-v6-keyThatDoesNotExists', '{"foo": "bar"}');
639-
expect(spy).toHaveBeenNthCalledWith(2, 'opt-datafile-v6-keyThatDoesNotExists', '{"foo2": "bar2"}');
640-
expect(spy).toHaveBeenNthCalledWith(3, 'opt-datafile-v6-keyThatDoesNotExists', '{"foo3": "bar3"}');
638+
expect(spy).toHaveBeenNthCalledWith(1, 'optimizely-datafile-keyThatDoesNotExists', '{"foo": "bar"}');
639+
expect(spy).toHaveBeenNthCalledWith(2, 'optimizely-datafile-keyThatDoesNotExists', '{"foo2": "bar2"}');
640+
expect(spy).toHaveBeenNthCalledWith(3, 'optimizely-datafile-keyThatDoesNotExists', '{"foo3": "bar3"}');
641641
});
642642

643643
it('logs an error if fetch request fails and does not call onUpdate handler', async () => {

‎lib/project_config/polling_datafile_manager.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class PollingDatafileManager extends BaseService implements DatafileManag
7373
logger,
7474
} = config;
7575
this.cache = cache;
76-
this.cacheKey = 'optimizely-datafile' + sdkKey;
76+
this.cacheKey = 'optimizely-datafile-' + sdkKey;
7777
this.sdkKey = sdkKey;
7878
this.datafileAccessToken = datafileAccessToken;
7979
this.customHeaders = customHeaders;

0 commit comments

Comments
 (0)