From 1ce06a40e3718fc758dfb7d14854ce5463939196 Mon Sep 17 00:00:00 2001 From: Matthew Wall Date: Wed, 4 Sep 2024 11:25:23 -0400 Subject: [PATCH] re-enable for e2e --- .../asset-list/RecyclerAssetList2/NFTEmptyState.tsx | 2 +- .../asset-list/RecyclerAssetList2/NFTLoadingSkeleton.tsx | 3 ++- .../RecyclerAssetList2/WrappedCollectiblesHeader.tsx | 3 ++- .../asset-list/RecyclerAssetList2/WrappedNFT.tsx | 3 ++- .../RecyclerAssetList2/WrappedTokenFamilyHeader.tsx | 3 ++- .../RecyclerAssetList2/core/getLayoutProvider.tsx | 7 +++---- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/components/asset-list/RecyclerAssetList2/NFTEmptyState.tsx b/src/components/asset-list/RecyclerAssetList2/NFTEmptyState.tsx index 3826c2ce783..cae66bb27ae 100644 --- a/src/components/asset-list/RecyclerAssetList2/NFTEmptyState.tsx +++ b/src/components/asset-list/RecyclerAssetList2/NFTEmptyState.tsx @@ -66,7 +66,7 @@ export function NFTEmptyState() { data: { featuredMint }, } = useMints({ walletAddress: accountAddress }); - const nftsEnabled = useExperimentalFlag(NFTS_ENABLED) || nfts_enabled; + const nftsEnabled = (useExperimentalFlag(NFTS_ENABLED) || nfts_enabled) && !IS_TEST; const mintsEnabled = (useExperimentalFlag(MINTS) || mints_enabled) && !IS_TEST; if (!nftsEnabled) return null; diff --git a/src/components/asset-list/RecyclerAssetList2/NFTLoadingSkeleton.tsx b/src/components/asset-list/RecyclerAssetList2/NFTLoadingSkeleton.tsx index ed226889fb1..4476b9aa2a9 100644 --- a/src/components/asset-list/RecyclerAssetList2/NFTLoadingSkeleton.tsx +++ b/src/components/asset-list/RecyclerAssetList2/NFTLoadingSkeleton.tsx @@ -6,6 +6,7 @@ import { opacity } from '@/__swaps__/utils/swaps'; import { deviceUtils } from '@/utils'; import { NFTS_ENABLED, useExperimentalFlag } from '@/config'; import { useRemoteConfig } from '@/model/remoteConfig'; +import { IS_TEST } from '@/env'; export const TokenFamilyHeaderHeight = 50; @@ -48,7 +49,7 @@ const NFTItem = () => { const NFTLoadingSkeleton = ({ items = 5 }) => { const { nfts_enabled } = useRemoteConfig(); - const nftsEnabled = useExperimentalFlag(NFTS_ENABLED) || nfts_enabled; + const nftsEnabled = (useExperimentalFlag(NFTS_ENABLED) || nfts_enabled) && !IS_TEST; if (!nftsEnabled) return null; diff --git a/src/components/asset-list/RecyclerAssetList2/WrappedCollectiblesHeader.tsx b/src/components/asset-list/RecyclerAssetList2/WrappedCollectiblesHeader.tsx index dd2e35bc445..de588f3e021 100644 --- a/src/components/asset-list/RecyclerAssetList2/WrappedCollectiblesHeader.tsx +++ b/src/components/asset-list/RecyclerAssetList2/WrappedCollectiblesHeader.tsx @@ -6,6 +6,7 @@ import { NftCollectionSortCriterion } from '@/graphql/__generated__/arc'; import useNftSort from '@/hooks/useNFTsSortBy'; import { useRemoteConfig } from '@/model/remoteConfig'; import { NFTS_ENABLED, useExperimentalFlag } from '@/config'; +import { IS_TEST } from '@/env'; const TokenFamilyHeaderHeight = 48; @@ -33,7 +34,7 @@ const getMenuItemIcon = (value: NftCollectionSortCriterion) => { const CollectiblesHeader = () => { const { nfts_enabled } = useRemoteConfig(); - const nftsEnabled = useExperimentalFlag(NFTS_ENABLED) || nfts_enabled; + const nftsEnabled = (useExperimentalFlag(NFTS_ENABLED) || nfts_enabled) && !IS_TEST; const { nftSort, updateNFTSort } = useNftSort(); if (!nftsEnabled) return null; diff --git a/src/components/asset-list/RecyclerAssetList2/WrappedNFT.tsx b/src/components/asset-list/RecyclerAssetList2/WrappedNFT.tsx index 60db768c80c..e17a6e41bf8 100644 --- a/src/components/asset-list/RecyclerAssetList2/WrappedNFT.tsx +++ b/src/components/asset-list/RecyclerAssetList2/WrappedNFT.tsx @@ -11,6 +11,7 @@ import { useNavigation } from '@/navigation'; import Routes from '@/navigation/routesNames'; import { useRemoteConfig } from '@/model/remoteConfig'; import { NFTS_ENABLED, useExperimentalFlag } from '@/config'; +import { IS_TEST } from '@/env'; export default React.memo(function WrappedNFT({ onPress, @@ -24,7 +25,7 @@ export default React.memo(function WrappedNFT({ externalAddress?: string; }) { const { nfts_enabled } = useRemoteConfig(); - const nftsEnabled = useExperimentalFlag(NFTS_ENABLED) || nfts_enabled; + const nftsEnabled = (useExperimentalFlag(NFTS_ENABLED) || nfts_enabled) && !IS_TEST; const assetCollectible = useCollectible(uniqueId, externalAddress); diff --git a/src/components/asset-list/RecyclerAssetList2/WrappedTokenFamilyHeader.tsx b/src/components/asset-list/RecyclerAssetList2/WrappedTokenFamilyHeader.tsx index d0192584da6..9781c473237 100644 --- a/src/components/asset-list/RecyclerAssetList2/WrappedTokenFamilyHeader.tsx +++ b/src/components/asset-list/RecyclerAssetList2/WrappedTokenFamilyHeader.tsx @@ -4,6 +4,7 @@ import { useLatestCallback, useOpenFamilies } from '@/hooks'; import { ThemeContextProps } from '@/theme'; import { useRemoteConfig } from '@/model/remoteConfig'; import { NFTS_ENABLED, useExperimentalFlag } from '@/config'; +import { IS_TEST } from '@/env'; type Props = { name: string; @@ -15,7 +16,7 @@ type Props = { export default React.memo(function WrappedTokenFamilyHeader({ name, total, image, theme, testID }: Props) { const { nfts_enabled } = useRemoteConfig(); - const nftsEnabled = useExperimentalFlag(NFTS_ENABLED) || nfts_enabled; + const nftsEnabled = (useExperimentalFlag(NFTS_ENABLED) || nfts_enabled) && !IS_TEST; const { openFamilies, updateOpenFamilies } = useOpenFamilies(); const isFamilyOpen = openFamilies[name]; diff --git a/src/components/asset-list/RecyclerAssetList2/core/getLayoutProvider.tsx b/src/components/asset-list/RecyclerAssetList2/core/getLayoutProvider.tsx index 98dc12b41d1..ffe67eafd07 100644 --- a/src/components/asset-list/RecyclerAssetList2/core/getLayoutProvider.tsx +++ b/src/components/asset-list/RecyclerAssetList2/core/getLayoutProvider.tsx @@ -6,6 +6,7 @@ import { getRemoteConfig, RainbowConfig } from '@/model/remoteConfig'; import { NFTS_ENABLED, REMOTE_CARDS, useExperimentalFlag } from '@/config'; import { useContext } from 'react'; import { RainbowContextType } from '@/helpers/RainbowContext'; +import { IS_TEST } from '@/env'; const getStyleOverridesForIndex = (indices: number[]) => (index: number) => { if (indices.includes(index)) { @@ -34,8 +35,6 @@ class BetterLayoutProvider extends LayoutProvider { } } -// briefSectionsData: BaseCellType[], isCoinListEdited: boolean, cardIds: string[], isReadOnlyWallet: boolean - const getLayoutProvider = ({ briefSectionsData, isCoinListEdited, @@ -51,8 +50,8 @@ const getLayoutProvider = ({ experimentalConfig: ReturnType>['config']; remoteConfig: RainbowConfig; }) => { - const remoteCardsEnabled = remoteConfig.remote_cards_enabled || experimentalConfig[REMOTE_CARDS]; - const nftsEnabled = remoteConfig.nfts_enabled || experimentalConfig[NFTS_ENABLED]; + const remoteCardsEnabled = (remoteConfig.remote_cards_enabled || experimentalConfig[REMOTE_CARDS]) && !IS_TEST; + const nftsEnabled = (remoteConfig.nfts_enabled || experimentalConfig[NFTS_ENABLED]) && !IS_TEST; const indicesToOverride = []; for (let i = 0; i < briefSectionsData.length; i++) {