Skip to content

Commit

Permalink
Respond to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jophish committed Oct 6, 2023
1 parent 2fc53e0 commit a4a0826
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/components/TokenBalance.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/fiatExchanges/FiatExchangeCurrency.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { getDynamicConfigParams } from 'src/statsig'
jest.mock('src/statsig', () => ({
getDynamicConfigParams: jest.fn(() => {
return {
enableCico: ['celo-alfajores'],
showCico: ['celo-alfajores'],
}
}),
}))
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/fiatExchanges/FiatExchangeCurrency.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
1 change: 0 additions & 1 deletion src/home/WalletHome.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
})),
Expand Down
2 changes: 0 additions & 2 deletions src/navigator/DrawerNavigator.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
})),
}))

Expand Down
2 changes: 1 addition & 1 deletion src/statsig/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
},
Expand Down
2 changes: 0 additions & 2 deletions src/tokens/Assets.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ jest.mock('src/statsig', () => {
return {
getFeatureGate: jest.fn(),
getDynamicConfigParams: jest.fn(() => ({
enableCico: ['celo-alfajores'],
showBalances: ['celo-alfajores'],
showTransfers: ['celo-alfajores'],
})),
}
})
Expand Down
8 changes: 1 addition & 7 deletions src/tokens/TokenBalances.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)

Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/transactions/feed/TransactionFeed.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
})),
Expand Down

0 comments on commit a4a0826

Please sign in to comment.