Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const ACCOUNT_LIST_CELL_TEST_IDS = {
ACCOUNT_LIST_CELL: 'account-list-cell-checkbox-',
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import AccountCell from '../../AccountCell';
import createStyles from '../MultichainAccountSelectorList.styles';
import { AccountListCellProps } from './AccountListCell.types';
import Checkbox from '../../../../components/Checkbox';
import { ACCOUNT_LIST_CELL_TEST_IDS } from './AccountListCell.testIds';

const AccountListCell = memo(
({
Expand All @@ -31,7 +32,9 @@ const AccountListCell = memo(
<AccountCell
startAccessory={
showCheckbox ? (
<View testID={`account-list-cell-checkbox-${accountGroup.id}`}>
<View
testID={`${ACCOUNT_LIST_CELL_TEST_IDS.ACCOUNT_LIST_CELL}${accountGroup.id}`}
>
<Checkbox isChecked={isSelected} onPress={handlePress} />
</View>
) : undefined
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const EXTERNAL_ACCOUNT_CELL_TEST_IDS = {
CONTAINER: 'external-account-cell-touchable',
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { getNetworkImageSource } from '../../../../../util/networks';
import { selectAvatarAccountType } from '../../../../../selectors/settings';
import { strings } from '../../../../../../locales/i18n';
import createStyles from '../MultichainAccountSelectorList.styles';
import { EXTERNAL_ACCOUNT_CELL_TEST_IDS } from './ExternalAccountCell.testIds';

/**
* ExternalAccountCell Component
Expand Down Expand Up @@ -56,7 +57,7 @@ const ExternalAccountCell: React.FC<ExternalAccountCellProps> = ({
styles.externalAccountContainer,
isDisabled && styles.externalAccountContainerDisabled,
]}
testID="external-account-cell-touchable"
testID={EXTERNAL_ACCOUNT_CELL_TEST_IDS.CONTAINER}
>
<AvatarAccount
accountAddress={address}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const BACKUP_AND_SYNC_FEATURES_TOGGLES_TEST_IDS = {
TOGGLE_ACCOUNT_SYNCING: 'toggle-accountSyncing',
TOGGLE_CONTACT_SYNCING: 'toggle-contactSyncing',
} as const;
Comment thread
cursor[bot] marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Icon, {
} from '../../../../component-library/components/Icons/Icon';
import { strings } from '../../../../../locales/i18n';
import { MetaMetricsEvents, useMetrics } from '../../../hooks/useMetrics';
import { BACKUP_AND_SYNC_FEATURES_TOGGLES_TEST_IDS } from './BackupAndSyncFeaturesToggles.testIds';

export const backupAndSyncFeaturesTogglesSections = [
{
Expand All @@ -29,15 +30,15 @@ export const backupAndSyncFeaturesTogglesSections = [
iconName: IconName.UserCircle,
backupAndSyncfeatureKey: BACKUPANDSYNC_FEATURES.accountSyncing,
featureReduxSelector: selectIsAccountSyncingEnabled,
testID: 'toggle-accountSyncing',
testID: BACKUP_AND_SYNC_FEATURES_TOGGLES_TEST_IDS.TOGGLE_ACCOUNT_SYNCING,
},
{
id: 'contacts',
titleI18NKey: strings('backupAndSync.features.contacts'),
iconName: IconName.Book,
backupAndSyncfeatureKey: BACKUPANDSYNC_FEATURES.contactSyncing,
featureReduxSelector: selectIsContactSyncingEnabled,
testID: 'toggle-contactSyncing',
testID: BACKUP_AND_SYNC_FEATURES_TOGGLES_TEST_IDS.TOGGLE_CONTACT_SYNCING,
},
];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const BACKUP_AND_SYNC_TOGGLE_TEST_IDS = {
TOGGLE: 'toggle-backupAndSync',
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { selectIsMetamaskNotificationsEnabled } from '../../../../selectors/noti
import Routes from '../../../../constants/navigation/Routes';
import { useNavigation } from '@react-navigation/native';
import { strings } from '../../../../../locales/i18n';
import { BACKUP_AND_SYNC_TOGGLE_TEST_IDS } from './BackupAndSyncToggle.testIds';

interface Props {
trackBackupAndSyncToggleEventOverride?: (newValue: boolean) => void;
Expand Down Expand Up @@ -160,7 +161,7 @@ const BackupAndSyncToggle = ({
}}
thumbColor={theme.brandColors.white}
ios_backgroundColor={colors.border.muted}
testID="toggle-backupAndSync"
testID={BACKUP_AND_SYNC_TOGGLE_TEST_IDS.TOGGLE}
/>
</View>
<Text variant={TextVariant.BodyMD} color={TextColor.Alternative}>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const SMART_ACCOUNT_MODAL_TEST_IDS = {
CONTAINER: 'smart-account-content',
SAFE_AREA: 'smart-account-safe-area',
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import Icon, {
IconName,
IconSize,
} from '../../../../../../component-library/components/Icons/Icon';
import { SMART_ACCOUNT_MODAL_TEST_IDS } from './SmartAccountModal.testIds';

interface RootNavigationParamList extends ParamListBase {
SmartAccount: {
Expand Down Expand Up @@ -67,7 +68,10 @@ const SmartAccountModal = () => {
}

return (
<SafeAreaView style={styles.safeArea} testID="smart-account-safe-area">
<SafeAreaView
style={styles.safeArea}
testID={SMART_ACCOUNT_MODAL_TEST_IDS.SAFE_AREA}
>
<HeaderBase
style={styles.header}
startAccessory={
Expand All @@ -82,7 +86,10 @@ const SmartAccountModal = () => {
{strings('multichain_accounts.account_details.smart_account')}
</HeaderBase>
<View style={styles.container}>
<View style={styles.contentContainer} testID="smart-account-content">
<View
style={styles.contentContainer}
testID={SMART_ACCOUNT_MODAL_TEST_IDS.CONTAINER}
>
<Box style={styles.cardContainer}>
<Text variant={TextVariant.BodyMDMedium}>
{strings('multichain_accounts.smart_account.title')}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const SMART_ACCOUNT_NETWORK_LIST_TEST_IDS = {
NETWORK_FLAT_LIST: 'network-flat-list',
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Hex } from '@metamask/utils';
import { useStyles } from '../../../../../hooks/useStyles';
import styleSheet from './SmartAccountNetworkList.styles';
import { Skeleton } from '../../../../../../component-library/components/Skeleton';
import { SMART_ACCOUNT_NETWORK_LIST_TEST_IDS } from './SmartAccountNetworkList.testIds';

interface SmartAccountNetworkListProps {
address: string;
Expand Down Expand Up @@ -54,7 +55,7 @@ const SmartAccountNetworkList = ({ address }: SmartAccountNetworkListProps) => {
}

return (
<Box testID="network-flat-list">
<Box testID={SMART_ACCOUNT_NETWORK_LIST_TEST_IDS.NETWORK_FLAT_LIST}>
{network7702List.map((network) => (
<AccountNetworkRow
key={network.chainId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import Routes from '../../../../constants/navigation/Routes';
import { RootState } from '../../../../reducers';
import { useDispatch, useSelector } from 'react-redux';
import { setMultichainAccountsIntroModalSeen } from '../../../../actions/user';
import { LEARN_MORE_BOTTOM_SHEET_TEST_IDS } from './LearnMoreBottomSheet.testIds';

interface LearnMoreBottomSheetProps {
onClose: () => void;
Expand Down Expand Up @@ -74,19 +75,19 @@ const LearnMoreBottomSheet: React.FC<LearnMoreBottomSheetProps> = ({
<ButtonIcon
onPress={handleBack}
iconName={IconName.ArrowLeft}
testID="learn-more-back-button"
testID={LEARN_MORE_BOTTOM_SHEET_TEST_IDS.BACK_BUTTON}
/>
<Text
variant={TextVariant.HeadingMd}
style={styles.title}
testID="learn-more-title"
testID={LEARN_MORE_BOTTOM_SHEET_TEST_IDS.TITLE}
>
{strings('multichain_accounts.learn_more.title')}
</Text>
<ButtonIcon
onPress={handleClose}
iconName={IconName.Close}
testID="learn-more-close-button"
testID={LEARN_MORE_BOTTOM_SHEET_TEST_IDS.CLOSE_BUTTON}
/>
</View>

Expand All @@ -95,7 +96,7 @@ const LearnMoreBottomSheet: React.FC<LearnMoreBottomSheetProps> = ({
variant={TextVariant.BodyMd}
color={TextColor.TextDefault}
style={styles.description}
testID="learn-more-description"
testID={LEARN_MORE_BOTTOM_SHEET_TEST_IDS.DESCRIPTION}
>
{strings('multichain_accounts.learn_more.description')}
</Text>
Expand All @@ -104,7 +105,7 @@ const LearnMoreBottomSheet: React.FC<LearnMoreBottomSheetProps> = ({
isChecked={isCheckboxChecked}
onPress={handleCheckboxToggle}
label={strings('multichain_accounts.learn_more.checkbox_label')}
testID="learn-more-checkbox"
testID={LEARN_MORE_BOTTOM_SHEET_TEST_IDS.CHECKBOX}
/>
</View>

Expand All @@ -116,7 +117,7 @@ const LearnMoreBottomSheet: React.FC<LearnMoreBottomSheetProps> = ({
width={ButtonWidthTypes.Full}
onPress={handleConfirm}
isDisabled={!isCheckboxChecked}
testID="learn-more-confirm-button"
testID={LEARN_MORE_BOTTOM_SHEET_TEST_IDS.CONFIRM_BUTTON}
/>
</View>
</View>
Expand Down
Loading