Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[FSSDK-13110] name update to tests
  • Loading branch information
junaed-optimizely committed Sep 14, 2026
commit 3ba3b7d73a3f60dec81c237ce2c15b6b8593a8b9
14 changes: 7 additions & 7 deletions lib/project_config/polling_datafile_manager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('PollingDatafileManager', () => {
const repeater = getMockRepeater();
const requestHandler = getMockRequestHandler(); // response promise is pending
const cache = getMockAsyncCache<string>();
await cache.set('opt-datafile-v6-keyThatExists', JSON.stringify({ name: 'keyThatExists' }));
await cache.set('optimizely-datafile-keyThatExists', JSON.stringify({ name: 'keyThatExists' }));

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

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

const manager = new PollingDatafileManager({
repeater,
Expand All @@ -155,7 +155,7 @@ describe('PollingDatafileManager', () => {
const repeater = getMockRepeater();
const requestHandler = getMockRequestHandler();
const cache = getMockAsyncCache<string>();
await cache.set('opt-datafile-v6-keyThatExists', JSON.stringify({ name: 'keyThatExists' }));
await cache.set('optimizely-datafile-keyThatExists', JSON.stringify({ name: 'keyThatExists' }));
const mockResponse = getMockAbortableRequest();
requestHandler.makeRequest.mockReturnValueOnce(mockResponse);

Expand Down Expand Up @@ -564,7 +564,7 @@ describe('PollingDatafileManager', () => {
repeater.execute(0);

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

Expand Down Expand Up @@ -635,9 +635,9 @@ describe('PollingDatafileManager', () => {
}

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

it('logs an error if fetch request fails and does not call onUpdate handler', async () => {
Expand Down
2 changes: 1 addition & 1 deletion lib/project_config/polling_datafile_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class PollingDatafileManager extends BaseService implements DatafileManag
logger,
} = config;
this.cache = cache;
this.cacheKey = 'optimizely-datafile' + sdkKey;
this.cacheKey = 'optimizely-datafile-' + sdkKey;
this.sdkKey = sdkKey;
this.datafileAccessToken = datafileAccessToken;
this.customHeaders = customHeaders;
Expand Down
Loading