Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Move files to the Browser folder #12034

Merged
merged 19 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
4336539
Move files to the Browser folder
SamuelSalas Oct 25, 2024
98aca2d
Merge branch 'main' into tes/2000-e2e-move-files-to-browser-folder
SamuelSalas Oct 25, 2024
b24190d
fix lint issues
SamuelSalas Oct 25, 2024
696835c
Restore DrawerView
SamuelSalas Oct 26, 2024
ca3ceb6
Merge branch 'main' into tes/2000-e2e-move-files-to-browser-folder
SamuelSalas Oct 28, 2024
1f8730b
Merge branch 'main' into tes/2000-e2e-move-files-to-browser-folder
SamuelSalas Oct 28, 2024
233f8ab
Merge branch 'main' into tes/2000-e2e-move-files-to-browser-folder
SamuelSalas Oct 28, 2024
50257c2
Readd removed methods and selectors from AddBookmarkView and BrowserV…
SamuelSalas Oct 28, 2024
14e2a85
Merge branch 'main' into tes/2000-e2e-move-files-to-browser-folder
SamuelSalas Oct 28, 2024
d50e0a6
Change modal to BottomSheet
SamuelSalas Oct 28, 2024
d6ffae9
refactor: replace swap slider with swap button (#12030)
bfullam Oct 28, 2024
5bdde0f
test: Move portfolio connect out of quarantine (#12023)
cortisiko Oct 28, 2024
830f7f2
Update selectors of bottomsheet
SamuelSalas Oct 28, 2024
b999662
Merge branch 'main' into tes/2000-e2e-move-files-to-browser-folder
SamuelSalas Oct 28, 2024
88af8ed
Update selectors of bottomsheet
SamuelSalas Oct 28, 2024
783a2f9
Merge branch 'main' into tes/2000-e2e-move-files-to-browser-folder
SamuelSalas Oct 28, 2024
192e8bd
Merge branch 'main' into tes/2000-e2e-move-files-to-browser-folder
SamuelSalas Oct 28, 2024
75e7deb
Change SigningModalSelectorsIDs for SigningBottomSheetSelectorsIDs
SamuelSalas Oct 28, 2024
2769e0b
Merge branch 'main' into tes/2000-e2e-move-files-to-browser-folder
SamuelSalas Oct 29, 2024
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
2 changes: 1 addition & 1 deletion app/components/UI/AccountApproval/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { shuffle } from 'lodash';
import URL from 'url-parse';
import AppConstants from '../../../../app/core/AppConstants';
import { CommonSelectorsIDs } from '../../../../e2e/selectors/Common.selectors';
import { ConnectAccountModalSelectorsIDs } from '../../../../e2e/selectors/Modals/ConnectAccountModal.selectors';
import { ConnectAccountModalSelectorsIDs } from '../../../../e2e/selectors/Browser/ConnectAccountModal.selectors';
import generateTestId from '../../../../wdio/utils/generateTestId';
import { withMetricsAwareness } from '../../../components/hooks/useMetrics';
import Routes from '../../../constants/navigation/Routes';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import renderWithProvider from '../../../util/test/renderWithProvider';
import AccountSelectorList from './AccountSelectorList';
import { useAccounts } from '../../../components/hooks/useAccounts';
import { View } from 'react-native';
import { ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID } from '../../../../wdio/screen-objects/testIDs/Components/AccountListComponent.testIds';
import { AccountListViewSelectorsIDs } from '../../../../e2e/selectors/AccountListView.selectors';
import { backgroundState } from '../../../util/test/initial-root-state';
import { regex } from '../../../../app/util/regex';
import {
Expand Down Expand Up @@ -128,10 +128,10 @@ describe('AccountSelectorList', () => {

await waitFor(async () => {
const businessAccountItem = await queryByTestId(
`${ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID}-${BUSINESS_ACCOUNT}`,
`${AccountListViewSelectorsIDs.ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID}-${BUSINESS_ACCOUNT}`,
);
const personalAccountItem = await queryByTestId(
`${ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID}-${PERSONAL_ACCOUNT}`,
`${AccountListViewSelectorsIDs.ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID}-${PERSONAL_ACCOUNT}`,
);

expect(within(businessAccountItem).getByText(regex.eth(1))).toBeDefined();
Expand Down Expand Up @@ -171,7 +171,7 @@ describe('AccountSelectorList', () => {
expect(accounts.length).toBe(1);

const businessAccountItem = await queryByTestId(
`${ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID}-${BUSINESS_ACCOUNT}`,
`${AccountListViewSelectorsIDs.ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID}-${BUSINESS_ACCOUNT}`,
);

expect(within(businessAccountItem).getByText(regex.eth(1))).toBeDefined();
Expand Down
10 changes: 3 additions & 7 deletions app/components/UI/AccountSelectorList/AccountSelectorList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Third party dependencies.
import React, { useCallback, useRef } from 'react';
import { Alert, ListRenderItem, Platform, View } from 'react-native';
import { Alert, ListRenderItem, View } from 'react-native';
import { FlatList } from 'react-native-gesture-handler';
import { useSelector } from 'react-redux';
import { KeyringTypes } from '@metamask/keyring-controller';
Expand Down Expand Up @@ -29,8 +29,7 @@ import { removeAccountsFromPermissions } from '../../../core/Permissions';
// Internal dependencies.
import { AccountSelectorListProps } from './AccountSelectorList.types';
import styleSheet from './AccountSelectorList.styles';
import generateTestId from '../../../../wdio/utils/generateTestId';
import { ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID } from '../../../../wdio/screen-objects/testIDs/Components/AccountListComponent.testIds.js';
import { AccountListViewSelectorsIDs } from '../../../../e2e/selectors/AccountListView.selectors';

const AccountSelectorList = ({
onSelectAccount,
Expand Down Expand Up @@ -68,10 +67,7 @@ const AccountSelectorList = ({
({ fiatBalance, tokens }: Assets, address: string) => (
<View
style={styles.balancesContainer}
{...generateTestId(
Platform,
`${ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID}-${address}`,
)}
testID={`${AccountListViewSelectorsIDs.ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID}-${address}`}
>
<Text style={styles.balanceLabel}>{fiatBalance}</Text>
{tokens && (
Expand Down
22 changes: 7 additions & 15 deletions app/components/UI/BrowserBottomBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,7 @@ import { MetaMetricsEvents } from '../../../core/Analytics';

import Device from '../../../util/device';
import { ThemeContext, mockTheme } from '../../../util/theme';
import generateTestId from '../../../../wdio/utils/generateTestId';
import {
HOME_BUTTON,
TABS_BUTTON,
FORWARD_BUTTON,
BACK_BUTTON,
OPTIONS_BUTTON,
SEARCH_BUTTON,
} from '../../../../wdio/screen-objects/testIDs/BrowserScreen/BrowserScreen.testIds';
import { BrowserViewSelectorsIDs } from '../../../../e2e/selectors/Browser/BrowserView.selectors';
import { withMetricsAwareness } from '../../../components/hooks/useMetrics';

// NOTE: not needed anymore. The use of BottomTabBar already accomodates the home indicator height
Expand Down Expand Up @@ -160,7 +152,7 @@ class BrowserBottomBar extends PureComponent {
<TouchableOpacity
onPress={onBackPress}
style={styles.iconButton}
{...generateTestId(Platform, BACK_BUTTON)}
testID={BrowserViewSelectorsIDs.BACK_BUTTON}
disabled={!canGoBack}
>
<Icon
Expand All @@ -172,7 +164,7 @@ class BrowserBottomBar extends PureComponent {
<TouchableOpacity
onPress={onForwardPress}
style={styles.iconButton}
{...generateTestId(Platform, FORWARD_BUTTON)}
testID={BrowserViewSelectorsIDs.FORWARD_BUTTON}
disabled={!canGoForward}
>
<Icon
Expand All @@ -184,30 +176,30 @@ class BrowserBottomBar extends PureComponent {
<TouchableOpacity
onPress={onSearchPress}
style={styles.iconButton}
{...generateTestId(Platform, SEARCH_BUTTON)}
testID={BrowserViewSelectorsIDs.SEARCH_BUTTON}
>
<FeatherIcons name="search" size={24} style={styles.icon} />
</TouchableOpacity>

<TouchableOpacity
onPress={showTabs}
style={styles.iconButton}
{...generateTestId(Platform, TABS_BUTTON)}
testID={BrowserViewSelectorsIDs.TABS_BUTTON}
>
<TabCountIcon style={styles.tabIcon} />
</TouchableOpacity>
<TouchableOpacity
onPress={onHomePress}
style={styles.iconButton}
{...generateTestId(Platform, HOME_BUTTON)}
testID={BrowserViewSelectorsIDs.HOME_BUTTON}
>
<SimpleLineIcons name="home" size={22} style={styles.icon} />
</TouchableOpacity>

<TouchableOpacity
onPress={toggleOptions}
style={styles.iconButton}
{...generateTestId(Platform, OPTIONS_BUTTON)}
testID={BrowserViewSelectorsIDs.OPTIONS_BUTTON}
>
<MaterialIcon name="more-horiz" size={22} style={styles.icon} />
</TouchableOpacity>
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/ManageNetworks/ManageNetworks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Routes from '../../../constants/navigation/Routes';
import getDecimalChainId from '../../../util/networks/getDecimalChainId';
import { useMetrics } from '../../../components/hooks/useMetrics';
import { MetaMetricsEvents } from '../../../core/Analytics';
import { ConnectedAccountsSelectorsIDs } from '../../../../e2e/selectors/Modals/ConnectedAccountModal.selectors';
import { ConnectedAccountsSelectorsIDs } from '../../../../e2e/selectors/Browser/ConnectedAccountModal.selectors';
import AppConstants from '../../../core/AppConstants';
import styles from './ManageNetworks.styles';

Expand Down
5 changes: 2 additions & 3 deletions app/components/UI/Tabs/TabCountIcon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import PropTypes from 'prop-types';
import { fontStyles } from '../../../../styles/common';
import { connect } from 'react-redux';
import { ThemeContext, mockTheme } from '../../../../util/theme';
import generateTestId from '../../../../../wdio/utils/generateTestId';
import { TABS_NUMBER } from '../../../../../wdio/screen-objects/testIDs/BrowserScreen/BrowserScreen.testIds';
import { BrowserViewSelectorsIDs } from '../../../../../e2e/selectors/Browser/BrowserView.selectors';

const createStyles = (colors) =>
StyleSheet.create({
Expand Down Expand Up @@ -51,7 +50,7 @@ class TabCountIcon extends PureComponent {
<View style={[styles.tabIcon, style]}>
<Text
style={styles.tabCount}
{...generateTestId(Platform, TABS_NUMBER)}
testID={BrowserViewSelectorsIDs.TABS_NUMBER}
>
{tabCount}
</Text>
Expand Down
15 changes: 5 additions & 10 deletions app/components/UI/Tabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ import {
import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons';
import { strings } from '../../../../locales/i18n';
import {
MULTI_TAB_ADD_BUTTON,
MULTI_TAB_CLOSE_ALL_BUTTON,
MULTI_TAB_DONE_BUTTON,
MULTI_TAB_NO_TABS_MESSAGE,
} from '../../../../wdio/screen-objects/testIDs/BrowserScreen/MultiTab.testIds';
import { BrowserViewSelectorsIDs } from '../../../../e2e/selectors/Browser/BrowserView.selectors';
import { MetaMetricsEvents } from '../../../core/Analytics';
import { fontStyles, colors as importedColors } from '../../../styles/common';
import Device from '../../../util/device';
Expand Down Expand Up @@ -233,7 +228,7 @@ class Tabs extends PureComponent {

return (
<View style={styles.noTabs}>
<Text style={styles.noTabsTitle} testID={MULTI_TAB_NO_TABS_MESSAGE}>
<Text style={styles.noTabsTitle} testID={BrowserViewSelectorsIDs.NO_TABS_MESSAGE}>
{strings('browser.no_tabs_title')}
</Text>
<Text style={styles.noTabsDesc}>{strings('browser.no_tabs_desc')}</Text>
Expand Down Expand Up @@ -286,7 +281,7 @@ class Tabs extends PureComponent {
<TouchableOpacity
style={[styles.tabAction, styles.tabActionleft]}
onPress={closeAllTabs}
testID={MULTI_TAB_CLOSE_ALL_BUTTON}
testID={BrowserViewSelectorsIDs.CLOSE_ALL_TABS}
>
<Text
style={[
Expand All @@ -301,7 +296,7 @@ class Tabs extends PureComponent {
<TouchableOpacity
style={styles.newTabIconButton}
onPress={this.onNewTabPress}
testID={MULTI_TAB_ADD_BUTTON}
testID={BrowserViewSelectorsIDs.ADD_NEW_TAB}
>
<MaterialCommunityIcon
name="plus"
Expand All @@ -314,7 +309,7 @@ class Tabs extends PureComponent {
<TouchableOpacity
style={[styles.tabAction, styles.tabActionRight]}
onPress={closeTabsView}
testID={MULTI_TAB_DONE_BUTTON}
testID={BrowserViewSelectorsIDs.DONE_BUTTON}
>
<Text
style={[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Third party dependencies.
import React, { useCallback, useState } from 'react';
import { Platform, View, SafeAreaView } from 'react-native';
import { View, SafeAreaView } from 'react-native';

// External dependencies.
import { strings } from '../../../../../locales/i18n';
import { ACCOUNT_APPROVAL_SELECT_ALL_BUTTON } from '../../../../../wdio/screen-objects/testIDs/Components/AccountApprovalModal.testIds';
import generateTestId from '../../../../../wdio/utils/generateTestId';
import Button, {
ButtonSize,
ButtonVariants,
Expand All @@ -24,8 +22,8 @@ import HelpText, {
} from '../../../../component-library/components/Form/HelpText';

// Internal dependencies.
import { ConnectAccountModalSelectorsIDs } from '../../../../../e2e/selectors/Modals/ConnectAccountModal.selectors';
import { ACCOUNT_LIST_ADD_BUTTON_ID } from '../../../../../wdio/screen-objects/testIDs/Components/AccountListComponent.testIds';
import { ConnectAccountModalSelectorsIDs } from '../../../../../e2e/selectors/Browser/ConnectAccountModal.selectors';
import { AccountListViewSelectorsIDs } from '../../../../../e2e/selectors/AccountListView.selectors';
import AddAccountActions from '../../AddAccountActions';
import styleSheet from './AccountConnectMultiSelector.styles';
import {
Expand Down Expand Up @@ -110,7 +108,7 @@ const AccountConnectMultiSelector = ({
...(isLoading && styles.disabled),
}}
label={strings('accounts.select_all')}
{...generateTestId(Platform, ACCOUNT_APPROVAL_SELECT_ALL_BUTTON)}
testID={ConnectAccountModalSelectorsIDs.SELECT_MULTI_BUTTON}
/>
),
[accounts, isLoading, onSelectAddress, styles],
Expand Down Expand Up @@ -230,10 +228,7 @@ const AccountConnectMultiSelector = ({
...(isConnectDisabled && styles.disabled),
}}
disabled={isConnectDisabled}
{...generateTestId(
Platform,
ConnectAccountModalSelectorsIDs.SELECT_MULTI_BUTTON,
)}
testID={ConnectAccountModalSelectorsIDs.SELECT_MULTI_BUTTON}
/>
)}
</View>
Expand Down Expand Up @@ -338,7 +333,7 @@ const AccountConnectMultiSelector = ({
onPress={() =>
setScreen(AccountConnectMultiSelectorScreens.AddAccountActions)
}
{...generateTestId(Platform, ACCOUNT_LIST_ADD_BUTTON_ID)}
testID={AccountListViewSelectorsIDs.ACCOUNT_LIST_ADD_BUTTON_ID}
/>
</View>
<View style={styles.body}>{renderCtaButtons()}</View>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Third party dependencies.
import React, { useCallback } from 'react';
import { Platform, View } from 'react-native';
import { View } from 'react-native';
import { useSelector } from 'react-redux';

// External dependencies.
Expand Down Expand Up @@ -35,8 +35,7 @@ import styleSheet from './AccountConnectSingle.styles';
import { AccountConnectSingleProps } from './AccountConnectSingle.types';

import { CommonSelectorsIDs } from '../../../../../e2e/selectors/Common.selectors';
import { ConnectAccountModalSelectorsIDs } from '../../../../../e2e/selectors/Modals/ConnectAccountModal.selectors';
import generateTestId from '../../../../../wdio/utils/generateTestId';
import { ConnectAccountModalSelectorsIDs } from '../../../../../e2e/selectors/Browser/ConnectAccountModal.selectors';

const AccountConnectSingle = ({
defaultSelectedAccount,
Expand Down Expand Up @@ -168,7 +167,7 @@ const AccountConnectSingle = ({
<SheetHeader title={strings('accounts.connect_account_title')} />
<View
style={styles.body}
{...generateTestId(Platform, ConnectAccountModalSelectorsIDs.CONTAINER)}
testID={ConnectAccountModalSelectorsIDs.CONTAINER}
>
<TagUrl
imageSource={favicon}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
ProviderConfig,
} from '../../../../selectors/networkController';
import { useNetworkInfo } from '../../../../selectors/selectedNetworkController';
import { ConnectedAccountsSelectorsIDs } from '../../../../../e2e/selectors/Modals/ConnectedAccountModal.selectors';
import { ConnectedAccountsSelectorsIDs } from '../../../../../e2e/selectors/Browser/ConnectedAccountModal.selectors';

// Internal dependencies.
import { AccountPermissionsConnectedProps } from './AccountPermissionsConnected.types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { IconName } from '../../../../component-library/components/Icons/Icon';
import Avatar from '../../../../component-library/components/Avatars/Avatar/Avatar';
import { AvatarVariant } from '../../../../component-library/components/Avatars/Avatar';
import { selectNetworkConfigurations } from '../../../../selectors/networkController';
import { ConnectedAccountsSelectorsIDs } from '../../../../../e2e/selectors/Modals/ConnectedAccountModal.selectors';
import { ConnectedAccountsSelectorsIDs } from '../../../../../e2e/selectors/Browser/ConnectedAccountModal.selectors';
import { useMetrics } from '../../../../components/hooks/useMetrics';

const AccountPermissionsRevoke = ({
Expand Down
5 changes: 2 additions & 3 deletions app/components/Views/Browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { Dimensions, Platform, View } from 'react-native';
import { captureScreen } from 'react-native-view-shot';
import { connect, useSelector } from 'react-redux';
import { strings } from '../../../../locales/i18n';
import { BROWSER_SCREEN_ID } from '../../../../wdio/screen-objects/testIDs/BrowserScreen/BrowserScreen.testIds';
import generateTestId from '../../../../wdio/utils/generateTestId';
import { BrowserViewSelectorsIDs } from '../../../../e2e/selectors/Browser/BrowserView.selectors';
import {
closeAllTabs,
closeTab,
Expand Down Expand Up @@ -370,7 +369,7 @@ export const Browser = (props) => {
return (
<View
style={baseStyles.flexGrow}
{...generateTestId(Platform, BROWSER_SCREEN_ID)}
testID={BrowserViewSelectorsIDs.BROWSER_SCREEN_ID}
>
{renderBrowserTabs()}
{renderTabsView()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import ExpandedMessage from '../SignatureRequest/ExpandedMessage';
import createStyles from './styles';
import { PersonalSignProps } from './types';

import { SigningModalSelectorsIDs } from '../../../../../../e2e/selectors/Modals/SigningModal.selectors';
import { SigningModalSelectorsIDs } from '../../../../../../e2e/selectors/Browser/SigningModal.selectors';
import { useMetrics } from '../../../../../components/hooks/useMetrics';
import AppConstants from '../../../../../core/AppConstants';
import { selectChainId } from '../../../../../selectors/networkController';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { PureComponent } from 'react';
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import Ionicons from 'react-native-vector-icons/Ionicons';
import { connect } from 'react-redux';
import { SigningModalSelectorsIDs } from '../../../../../../e2e/selectors/Modals/SigningModal.selectors';
import { SigningModalSelectorsIDs } from '../../../../../../e2e/selectors/Browser/SigningModal.selectors';
import { strings } from '../../../../../../locales/i18n';
import { withMetricsAwareness } from '../../../../../components/hooks/useMetrics';
import ExtendedKeyringTypes from '../../../../../constants/keyringTypes';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
} from '../../../../../util/confirmation/signatureUtils';
import { isExternalHardwareAccount } from '../../../../../util/address';
import createExternalSignModelNav from '../../../../../util/hardwareWallet/signatureUtils';
import { SigningModalSelectorsIDs } from '../../../../../../e2e/selectors/Modals/SigningModal.selectors';
import { SigningModalSelectorsIDs } from '../../../../../../e2e/selectors/Browser/SigningModal.selectors';
import { withMetricsAwareness } from '../../../../../components/hooks/useMetrics';

const createStyles = (colors) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import renderWithProvider from '../../../../../util/test/renderWithProvider';
import { fireEvent, waitFor } from '@testing-library/react-native';
import { MetaMetrics } from '../../../../../core/Analytics';
import { MOCK_ACCOUNTS_CONTROLLER_STATE } from '../../../../../util/test/accountsControllerTestUtils';
import { SigningModalSelectorsIDs } from '../../../../../../e2e/selectors/Modals/SigningModal.selectors';
import { SigningModalSelectorsIDs } from '../../../../../../e2e/selectors/Browser/SigningModal.selectors';

jest.mock('../../../../../core/Analytics/MetaMetrics');

Expand Down
8 changes: 4 additions & 4 deletions app/util/regex/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID } from '../../../wdio/screen-objects/testIDs/Components/AccountListComponent.testIds';
import { AccountListViewSelectorsIDs } from '../../../e2e/selectors/AccountListView.selectors';
import { regex, hasDecimals } from '.';

describe('REGEX :: hasDecimals', () => {
Expand Down Expand Up @@ -64,13 +64,13 @@ describe('REGEX :: REGEX_6400_USD', () => {
});

describe('REGEX :: regex.accountBalance', () => {
it(`should match "${ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID}"`, () => {
it(`should match "${AccountListViewSelectorsIDs.ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID}"`, () => {
expect(
regex.accountBalance.test(ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID),
regex.accountBalance.test(AccountListViewSelectorsIDs.ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID),
).toEqual(true);
});

it(`should not match "Account balance != ${ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID}"`, () => {
it(`should not match "Account balance != ${AccountListViewSelectorsIDs.ACCOUNT_BALANCE_BY_ADDRESS_TEST_ID}"`, () => {
expect(regex.accountBalance.test('123')).toEqual(false);
});
});
Expand Down
Loading
Loading