diff --git a/app/components/UI/NetworkSelectorList/NetworkSelectorList.tsx b/app/components/UI/NetworkSelectorList/NetworkSelectorList.tsx index 551146856e0..7fa0acdcb58 100644 --- a/app/components/UI/NetworkSelectorList/NetworkSelectorList.tsx +++ b/app/components/UI/NetworkSelectorList/NetworkSelectorList.tsx @@ -1,6 +1,6 @@ // Third party dependencies. import React, { useCallback, useRef } from 'react'; -import { ListRenderItem, ImageSourcePropType } from 'react-native'; +import { ListRenderItem, ImageSourcePropType, View } from 'react-native'; import { FlatList } from 'react-native-gesture-handler'; // External dependencies. @@ -53,23 +53,26 @@ const NetworkSelectorList = ({ if (selectedChainIds) { isSelectedNetwork = selectedChainIds.includes(id); } - return ( - onSelectNetwork?.(id, isSelectedNetwork)} - avatarProps={{ - variant: AvatarVariant.Network, - name, - imageSource: imageSource as ImageSourcePropType, - size: AvatarSize.Sm, - }} - disabled={isDisabled} + - {renderRightAccessory?.(id, name)} - + onSelectNetwork?.(id, isSelectedNetwork)} + avatarProps={{ + variant: AvatarVariant.Network, + name, + imageSource: imageSource as ImageSourcePropType, + size: AvatarSize.Sm, + }} + disabled={isDisabled} + > + {renderRightAccessory?.(id, name)} + + ); }, [ diff --git a/e2e/pages/Browser/NetworkConnectMultiSelector.js b/e2e/pages/Browser/NetworkConnectMultiSelector.js index 36a9d8f1b02..210aa040e14 100644 --- a/e2e/pages/Browser/NetworkConnectMultiSelector.js +++ b/e2e/pages/Browser/NetworkConnectMultiSelector.js @@ -22,6 +22,24 @@ class NetworkConnectMultiSelector { async tapBackButton() { await Gestures.waitAndTap(this.backButton); } + + async isNetworkChainPermissionSelected(chainName) { + const chainPermissionTestId = `${chainName}-selected`; + + const element = await Matchers.getElementByID(chainPermissionTestId); + await waitFor(element).toBeVisible().withTimeout(10000); + + return expect(element).toExist(); + } + + async isNetworkChainPermissionNotSelected(chainName) { + const chainPermissionTestId = `${chainName}-not-selected`; + + const element = await Matchers.getElementByID(chainPermissionTestId); + await waitFor(element).toBeVisible().withTimeout(10000); + + return expect(element).toExist(); + } } export default new NetworkConnectMultiSelector(); diff --git a/e2e/specs/multichain/permissions/chains/permission-system-update-permissions.spec.js b/e2e/specs/multichain/permissions/chains/permission-system-update-permissions.spec.js index a4b50516810..0debb5b8070 100644 --- a/e2e/specs/multichain/permissions/chains/permission-system-update-permissions.spec.js +++ b/e2e/specs/multichain/permissions/chains/permission-system-update-permissions.spec.js @@ -54,14 +54,11 @@ describe(SmokeMultiChain('Chain Permission Management'), () => { // Verify changes were saved by checking chain permissions again await ConnectedAccountsModal.tapNavigateToEditNetworksPermissionsButton(); - - // Deselect both networks to verify they were the only ones selected - await NetworkNonPemittedBottomSheet.tapEthereumMainNetNetworkName(); - await NetworkNonPemittedBottomSheet.tapLineaSepoliaNetworkName(); - - // Verify the disconnect all button appears (indicating no chains are selected) - await Assertions.checkIfVisible( - ConnectedAccountsModal.disconnectNetworksButton, + await NetworkConnectMultiSelector.isNetworkChainPermissionSelected( + NetworkNonPemittedBottomSheetSelectorsText.ETHEREUM_MAIN_NET_NETWORK_NAME, + ); + await NetworkConnectMultiSelector.isNetworkChainPermissionSelected( + NetworkNonPemittedBottomSheetSelectorsText.LINEA_SEPOLIA_NETWORK_NAME, ); }, );