diff --git a/packages/suite/src/middlewares/suite/__tests__/messageSystemMiddleware.test.ts b/packages/suite/src/middlewares/suite/__tests__/messageSystemMiddleware.test.ts index 08c9d8dbcbf..7952dce7454 100644 --- a/packages/suite/src/middlewares/suite/__tests__/messageSystemMiddleware.test.ts +++ b/packages/suite/src/middlewares/suite/__tests__/messageSystemMiddleware.test.ts @@ -96,7 +96,7 @@ describe('Message system middleware', () => { message3, message4, ]); - jest.spyOn(messageSystemUtils, 'getValidExperiments').mockImplementation(() => []); + jest.spyOn(messageSystemUtils, 'getValidExperimentIds').mockImplementation(() => []); const store = initStore(getInitialState(undefined, undefined)); store.dispatch({ @@ -128,7 +128,7 @@ describe('Message system middleware', () => { it('saves messages even if there are no valid messages', () => { jest.spyOn(messageSystemUtils, 'getValidMessages').mockImplementation(() => []); - jest.spyOn(messageSystemUtils, 'getValidExperiments').mockImplementation(() => []); + jest.spyOn(messageSystemUtils, 'getValidExperimentIds').mockImplementation(() => []); const store = initStore(getInitialState(undefined, undefined)); store.dispatch({ @@ -168,7 +168,7 @@ describe('Message system middleware', () => { ], }; - jest.spyOn(messageSystemUtils, 'getValidExperiments').mockImplementation(() => [ + jest.spyOn(messageSystemUtils, 'getValidExperimentIds').mockImplementation(() => [ experiment1.id, ]); diff --git a/packages/suite/src/middlewares/suite/messageSystemMiddleware.ts b/packages/suite/src/middlewares/suite/messageSystemMiddleware.ts index 1d927b338e7..0814967c184 100644 --- a/packages/suite/src/middlewares/suite/messageSystemMiddleware.ts +++ b/packages/suite/src/middlewares/suite/messageSystemMiddleware.ts @@ -6,7 +6,7 @@ import { messageSystemActions, categorizeMessages, getValidMessages, - getValidExperiments, + getValidExperimentIds, } from '@suite-common/message-system'; import { SUITE } from 'src/actions/suite/constants'; @@ -50,10 +50,10 @@ const messageSystemMiddleware = const validMessages = getValidMessages(config, validationParams); const categorizedValidMessages = categorizeMessages(validMessages); - const validExperiments = getValidExperiments(config, validationParams); + const validExperimentIds = getValidExperimentIds(config, validationParams); api.dispatch(messageSystemActions.updateValidMessages(categorizedValidMessages)); - api.dispatch(messageSystemActions.updateValidExperiments(validExperiments)); + api.dispatch(messageSystemActions.updateValidExperiments(validExperimentIds)); } return action; diff --git a/suite-common/message-system/src/__fixtures__/messageSystemUtils.ts b/suite-common/message-system/src/__fixtures__/messageSystemUtils.ts index c48784e61d4..82b132a832c 100644 --- a/suite-common/message-system/src/__fixtures__/messageSystemUtils.ts +++ b/suite-common/message-system/src/__fixtures__/messageSystemUtils.ts @@ -1945,9 +1945,9 @@ export const validateExperiments = [ }, ]; -export const getValidExperiments = [ +export const getValidExperimentIds = [ { - description: 'getValidExperiments - case 1', + description: 'getValidExperimentIds - case 1', currentDate: '2021-04-01T12:10:00.000Z', userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36', diff --git a/suite-common/message-system/src/__tests__/messageSystemUtils.test.ts b/suite-common/message-system/src/__tests__/messageSystemUtils.test.ts index 839f225b3f3..426b70fe2ff 100644 --- a/suite-common/message-system/src/__tests__/messageSystemUtils.test.ts +++ b/suite-common/message-system/src/__tests__/messageSystemUtils.test.ts @@ -127,7 +127,7 @@ describe('Message system utils', () => { }); }); - describe('getValidExperiments', () => { + describe('getValidExperimentIds', () => { let userAgentGetter: any; const OLD_ENV = { ...process.env }; @@ -140,7 +140,7 @@ describe('Message system utils', () => { process.env = OLD_ENV; }); - fixtures.getValidExperiments.forEach(f => { + fixtures.getValidExperimentIds.forEach(f => { it(f.description, () => { jest.spyOn(Date, 'now').mockImplementation(() => new Date(f.currentDate).getTime()); // @ts-expect-error (getOsName returns union of string literals) @@ -151,7 +151,7 @@ describe('Message system utils', () => { process.env.VERSION = f.suiteVersion; // @ts-expect-error - expect(messageSystem.getValidExperiments(f.config, f.options)).toEqual(f.result); + expect(messageSystem.getValidExperimentIds(f.config, f.options)).toEqual(f.result); }); }); }); diff --git a/suite-common/message-system/src/messageSystemUtils.ts b/suite-common/message-system/src/messageSystemUtils.ts index ba85e58ead3..891d464a4a3 100644 --- a/suite-common/message-system/src/messageSystemUtils.ts +++ b/suite-common/message-system/src/messageSystemUtils.ts @@ -288,7 +288,7 @@ export const getValidMessages = (config: MessageSystem | null, options: Options) .map(action => action.message); }; -export const getValidExperiments = (config: MessageSystem | null, options: Options): string[] => { +export const getValidExperimentIds = (config: MessageSystem | null, options: Options): string[] => { if (!config?.experiments) { return []; } diff --git a/suite-native/message-system/src/messageSystemMiddleware.ts b/suite-native/message-system/src/messageSystemMiddleware.ts index 675e6177909..c29f685e972 100644 --- a/suite-native/message-system/src/messageSystemMiddleware.ts +++ b/suite-native/message-system/src/messageSystemMiddleware.ts @@ -6,7 +6,7 @@ import { categorizeMessages, getValidMessages, selectMessageSystemConfig, - getValidExperiments, + getValidExperimentIds, } from '@suite-common/message-system'; import { deviceActions, selectSelectedDevice } from '@suite-common/wallet-core'; import { @@ -42,10 +42,10 @@ export const messageSystemMiddleware = createMiddleware((action, { next, dispatc const validMessages = getValidMessages(config, validationParams); const categorizedValidMessages = categorizeMessages(validMessages); - const validExperiments = getValidExperiments(config, validationParams); + const validExperimentIds = getValidExperimentIds(config, validationParams); dispatch(messageSystemActions.updateValidMessages(categorizedValidMessages)); - dispatch(messageSystemActions.updateValidExperiments(validExperiments)); + dispatch(messageSystemActions.updateValidExperiments(validExperimentIds)); } return action;