From a4a0826d4e2e827dd68c0279491cd26966ada16f Mon Sep 17 00:00:00 2001 From: Joseph Bergeron Date: Fri, 6 Oct 2023 18:18:42 -0400 Subject: [PATCH] Respond to comments --- src/components/TokenBalance.test.tsx | 2 +- src/fiatExchanges/FiatExchangeCurrency.test.tsx | 4 ++-- src/fiatExchanges/FiatExchangeCurrency.tsx | 2 +- src/home/WalletHome.test.tsx | 1 - src/navigator/DrawerNavigator.test.tsx | 2 -- src/statsig/constants.ts | 2 +- src/tokens/Assets.test.tsx | 2 -- src/tokens/TokenBalances.test.tsx | 8 +------- src/transactions/feed/TransactionFeed.test.tsx | 2 +- 9 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/components/TokenBalance.test.tsx b/src/components/TokenBalance.test.tsx index 7c5ee00f793..8bd1157a29d 100644 --- a/src/components/TokenBalance.test.tsx +++ b/src/components/TokenBalance.test.tsx @@ -49,7 +49,7 @@ const defaultStore = { jest.mocked(getFeatureGate).mockReturnValue(true) jest.mocked(getDynamicConfigParams).mockReturnValue({ - showBalances: [NetworkId['celo-alfajores'], NetworkId['ethereum-sepolia']], + showBalances: [NetworkId['celo-alfajores']], }) describe('FiatExchangeTokenBalance and HomeTokenBalance', () => { diff --git a/src/fiatExchanges/FiatExchangeCurrency.test.tsx b/src/fiatExchanges/FiatExchangeCurrency.test.tsx index 46ccc719ca7..c8ea7749413 100644 --- a/src/fiatExchanges/FiatExchangeCurrency.test.tsx +++ b/src/fiatExchanges/FiatExchangeCurrency.test.tsx @@ -13,7 +13,7 @@ import { getDynamicConfigParams } from 'src/statsig' jest.mock('src/statsig', () => ({ getDynamicConfigParams: jest.fn(() => { return { - enableCico: ['celo-alfajores'], + showCico: ['celo-alfajores'], } }), })) @@ -84,7 +84,7 @@ describe('FiatExchangeCurrency', () => { }) it('ETH Flow', () => { jest.mocked(getDynamicConfigParams).mockReturnValueOnce({ - enableCico: [NetworkId['celo-alfajores'], NetworkId['ethereum-sepolia']], + showCico: [NetworkId['celo-alfajores'], NetworkId['ethereum-sepolia']], }) const store = createMockStore({}) const tree = render( diff --git a/src/fiatExchanges/FiatExchangeCurrency.tsx b/src/fiatExchanges/FiatExchangeCurrency.tsx index 658f882dba6..632f2db022e 100644 --- a/src/fiatExchanges/FiatExchangeCurrency.tsx +++ b/src/fiatExchanges/FiatExchangeCurrency.tsx @@ -110,7 +110,7 @@ function FiatExchangeCurrency({ route, navigation }: Props) { // TODO: Update this to actually respect all possible networkIds correctly const showEth = getDynamicConfigParams( DynamicConfigs[StatsigDynamicConfigs.MULTI_CHAIN_FEATURES] - ).enableCico.includes(networkConfig.networkToNetworkId[Network.Ethereum]) + ).showCico.includes(networkConfig.networkToNetworkId[Network.Ethereum]) // Fetch FiatConnect providers silently in the background early in the CICO funnel useEffect(() => { diff --git a/src/home/WalletHome.test.tsx b/src/home/WalletHome.test.tsx index 37ddedf292e..9d086ef3ab2 100644 --- a/src/home/WalletHome.test.tsx +++ b/src/home/WalletHome.test.tsx @@ -130,7 +130,6 @@ jest.mock('src/statsig', () => ({ })), getFeatureGate: jest.fn().mockReturnValue(false), getDynamicConfigParams: jest.fn(() => ({ - enableCico: ['celo-alfajores'], showBalances: ['celo-alfajores'], showTransfers: ['celo-alfajores'], })), diff --git a/src/navigator/DrawerNavigator.test.tsx b/src/navigator/DrawerNavigator.test.tsx index 90e11f6a278..fb67c1ed842 100644 --- a/src/navigator/DrawerNavigator.test.tsx +++ b/src/navigator/DrawerNavigator.test.tsx @@ -11,9 +11,7 @@ jest.mock('src/statsig', () => ({ getExperimentParams: jest.fn(), getFeatureGate: jest.fn().mockReturnValue(false), getDynamicConfigParams: jest.fn(() => ({ - enableCico: ['celo-alfajores'], showBalances: ['celo-alfajores'], - showTransfers: ['celo-alfajores'], })), })) diff --git a/src/statsig/constants.ts b/src/statsig/constants.ts index f450e89dc15..ccfa6165614 100644 --- a/src/statsig/constants.ts +++ b/src/statsig/constants.ts @@ -92,7 +92,7 @@ export const DynamicConfigs = { [StatsigDynamicConfigs.MULTI_CHAIN_FEATURES]: { configName: StatsigDynamicConfigs.MULTI_CHAIN_FEATURES, defaultValues: { - enableCico: [networkConfig.defaultNetworkId], + showCico: [networkConfig.defaultNetworkId], showBalances: [networkConfig.defaultNetworkId], showTransfers: [networkConfig.defaultNetworkId], }, diff --git a/src/tokens/Assets.test.tsx b/src/tokens/Assets.test.tsx index 7e9d42a13a2..91c0b3d8d35 100644 --- a/src/tokens/Assets.test.tsx +++ b/src/tokens/Assets.test.tsx @@ -22,9 +22,7 @@ jest.mock('src/statsig', () => { return { getFeatureGate: jest.fn(), getDynamicConfigParams: jest.fn(() => ({ - enableCico: ['celo-alfajores'], showBalances: ['celo-alfajores'], - showTransfers: ['celo-alfajores'], })), } }) diff --git a/src/tokens/TokenBalances.test.tsx b/src/tokens/TokenBalances.test.tsx index 3359a6a3355..9b3c771561d 100644 --- a/src/tokens/TokenBalances.test.tsx +++ b/src/tokens/TokenBalances.test.tsx @@ -5,7 +5,7 @@ import { HomeEvents } from 'src/analytics/Events' import ValoraAnalytics from 'src/analytics/ValoraAnalytics' import { navigate } from 'src/navigator/NavigationService' import { Screens } from 'src/navigator/Screens' -import { getDynamicConfigParams, getFeatureGate } from 'src/statsig' +import { getFeatureGate } from 'src/statsig' import TokenBalancesScreen from 'src/tokens/TokenBalances' import { ONE_DAY_IN_MILLIS } from 'src/utils/time' import networkConfig from 'src/web3/networkConfig' @@ -191,9 +191,6 @@ describe('TokenBalancesScreen', () => { }) it('renders the correct components when there are positions', () => { - jest.mocked(getDynamicConfigParams).mockReturnValue({ - showBalances: [NetworkId['celo-alfajores'], NetworkId['ethereum-sepolia']], - }) jest.mocked(getFeatureGate).mockReturnValue(true) const store = createMockStore(storeWithPositions) @@ -214,9 +211,6 @@ describe('TokenBalancesScreen', () => { }) it('renders the correct information in positions', () => { - jest.mocked(getDynamicConfigParams).mockReturnValue({ - showBalances: [NetworkId['celo-alfajores'], NetworkId['ethereum-sepolia']], - }) jest.mocked(getFeatureGate).mockReturnValue(true) const store = createMockStore(storeWithPositions) diff --git a/src/transactions/feed/TransactionFeed.test.tsx b/src/transactions/feed/TransactionFeed.test.tsx index 90960fd34a1..1b773b478ff 100644 --- a/src/transactions/feed/TransactionFeed.test.tsx +++ b/src/transactions/feed/TransactionFeed.test.tsx @@ -19,7 +19,7 @@ import { mockCusdAddress } from 'test/values' jest.mock('src/statsig', () => ({ getFeatureGate: jest.fn(() => false), getDynamicConfigParams: jest.fn(() => ({ - enableCico: ['celo-alfajores'], + showCico: ['celo-alfajores'], showBalances: ['celo-alfajores'], showTransfers: ['celo-alfajores'], })),