diff --git a/src/app/store/config/EchoModel.tsx b/src/app/store/config/EchoModel.tsx index 94b2def6aec..08a5f370b87 100644 --- a/src/app/store/config/EchoModel.tsx +++ b/src/app/store/config/EchoModel.tsx @@ -36,7 +36,8 @@ export const getEchoModel = (): EchoModel => ({ state.state = echoJson }), fetchRemoteEcho: thunk(async (actions) => { - const disableRemoteFetch = unsafe_getDevToggle("DTDisableEchoRemoteFetch") + // Disable when dev toggle is enabled or when running tests + const disableRemoteFetch = unsafe_getDevToggle("DTDisableEchoRemoteFetch") || __TEST__ if (disableRemoteFetch) { return } diff --git a/src/setupJest.tsx b/src/setupJest.tsx index 2a78c5a2fec..a16d2e090e3 100644 --- a/src/setupJest.tsx +++ b/src/setupJest.tsx @@ -696,3 +696,15 @@ jest.mock("@react-native-community/geolocation", () => ({ setRNConfiguration: jest.fn(), stopObserving: jest.fn(), })) + +// Enable all feature flags by default + +jest.mock("app/store/GlobalStore", () => ({ + ...jest.requireActual("app/store/GlobalStore"), + unsafe_getFeatureFlag: jest.fn().mockReturnValue(true), +})) + +jest.mock("app/utils/hooks/useFeatureFlag", () => ({ + ...jest.requireActual("app/utils/hooks/useFeatureFlag"), + useFeatureFlag: jest.fn().mockReturnValue(true), +}))