diff --git a/src/components/AddExistingExpenseFooter.tsx b/src/components/AddExistingExpenseFooter.tsx index def2a31697b2..fd209495b097 100644 --- a/src/components/AddExistingExpenseFooter.tsx +++ b/src/components/AddExistingExpenseFooter.tsx @@ -45,7 +45,7 @@ type AddExistingExpenseFooterProps = { }; function AddExistingExpenseFooter({selectedIds, report, reportToConfirm, policy, policyCategories, errorMessage, setErrorMessage}: AddExistingExpenseFooterProps) { - const {translate} = useLocalize(); + const {translate, formatPhoneNumber} = useLocalize(); const styles = useThemeStyles(); const {isBetaEnabled} = usePermissions(); const isASAPSubmitBetaEnabled = isBetaEnabled(CONST.BETAS.ASAP_SUBMIT); @@ -92,6 +92,7 @@ function AddExistingExpenseFooter({selectedIds, report, reportToConfirm, policy, selfDMReportActions, delegateAccountID, isTrackIntentUser, + formatPhoneNumber, }); } else { changeTransactionsReport({ diff --git a/src/hooks/useDeleteTransactions.ts b/src/hooks/useDeleteTransactions.ts index 4c2e5a983ebd..fa1b7df19f4e 100644 --- a/src/hooks/useDeleteTransactions.ts +++ b/src/hooks/useDeleteTransactions.ts @@ -36,6 +36,7 @@ import {useCurrencyListActions} from './useCurrencyList'; import useCurrentUserPersonalDetails from './useCurrentUserPersonalDetails'; import useDelegateAccountID from './useDelegateAccountID'; import useEnvironment from './useEnvironment'; +import useLocalize from './useLocalize'; import useNetwork from './useNetwork'; import useOnyx from './useOnyx'; import usePermissions from './usePermissions'; @@ -110,6 +111,7 @@ function useDeleteTransactions({report, reportActions, policy}: UseDeleteTransac const restrictedActionPolicyID = useRestrictedActionPolicyID(policy); const {isOffline} = useNetwork(); const {isProduction} = useEnvironment(); + const {formatPhoneNumber} = useLocalize(); const getSplitExpenseEditTransactionOnDelete = useCallback( (transactionIDs: string[]): Transaction | undefined => { @@ -342,6 +344,7 @@ function useDeleteTransactions({report, reportActions, policy}: UseDeleteTransac isOffline, delegateAccountID, isTrackIntentUser, + formatPhoneNumber, }); } @@ -421,6 +424,7 @@ function useDeleteTransactions({report, reportActions, policy}: UseDeleteTransac personalPolicy?.outputCurrency, delegateAccountID, isTrackIntentUser, + formatPhoneNumber, getCurrencyDecimals, getCurrencySymbol, ], diff --git a/src/libs/IOUAmountSubmission.ts b/src/libs/IOUAmountSubmission.ts index 18dd8c5342f6..ee941cad8450 100644 --- a/src/libs/IOUAmountSubmission.ts +++ b/src/libs/IOUAmountSubmission.ts @@ -1,4 +1,4 @@ -import type {LocalizedTranslate} from '@components/LocaleContextProvider'; +import type {LocaleContextProps, LocalizedTranslate} from '@components/LocaleContextProvider'; import CONST from '@src/CONST'; import type {IOUAction, IOUType} from '@src/CONST'; @@ -78,6 +78,7 @@ type SubmitAmountArgs = { amount: string; paymentMethod?: PaymentMethodType; translate: LocalizedTranslate; + formatPhoneNumber: LocaleContextProps['formatPhoneNumber']; // Submit-time Onyx data — supplied by the screen via AmountSubmitDataSync so this module owns no subscriptions. allPersonalDetails: OnyxEntry; @@ -324,6 +325,7 @@ function submitSkipConfirmationExpense(args: SubmitAmountArgs, ctx: SubmitAmount action, currentUserPersonalDetails, isTrackIntentUser, + formatPhoneNumber, } = args; const {currentUserAccountID, currentUserEmail, existingTransactionID, isASAPSubmitBetaEnabled, newAmount: backendAmount} = ctx; @@ -409,6 +411,7 @@ function submitSkipConfirmationExpense(args: SubmitAmountArgs, ctx: SubmitAmount optimisticTransactionID, delegateAccountID, isTrackIntentUser, + formatPhoneNumber, }); } cleanupAfterSkipConfirmSubmit(overrides.shouldHandleNavigation, { diff --git a/src/libs/actions/IOU/Duplicate.ts b/src/libs/actions/IOU/Duplicate.ts index 6181a8a5555f..11ea10219ade 100644 --- a/src/libs/actions/IOU/Duplicate.ts +++ b/src/libs/actions/IOU/Duplicate.ts @@ -855,6 +855,7 @@ function duplicateExpenseTransaction({ shouldDeferAutoSubmit, isTrackIntentUser, delegateAccountID, + formatPhoneNumber, }; // If no workspace is provided the expense should be unreported @@ -1071,6 +1072,7 @@ function duplicateReport({ shouldDeferAutoSubmit: !isLastExpense, isTrackIntentUser, delegateAccountID, + formatPhoneNumber, }; const result = createExpenseByType({ diff --git a/src/libs/actions/IOU/MoneyRequest.ts b/src/libs/actions/IOU/MoneyRequest.ts index 81113f936dcd..42209cab6b0d 100644 --- a/src/libs/actions/IOU/MoneyRequest.ts +++ b/src/libs/actions/IOU/MoneyRequest.ts @@ -1,4 +1,4 @@ -import type {LocalizedTranslate} from '@components/LocaleContextProvider'; +import type {LocaleContextProps, LocalizedTranslate} from '@components/LocaleContextProvider'; import type {CurrencyListActionsContextType} from '@hooks/useCurrencyList'; @@ -102,6 +102,7 @@ type CreateTransactionParams = { currentUserLocalCurrency: string | undefined; isTrackIntentUser: boolean | undefined; delegateAccountID: number | undefined; + formatPhoneNumber: LocaleContextProps['formatPhoneNumber']; }; function createTransaction({ @@ -132,6 +133,7 @@ function createTransaction({ currentUserLocalCurrency, isTrackIntentUser, delegateAccountID, + formatPhoneNumber, }: CreateTransactionParams) { const draftTransactionIDs = Object.keys(allTransactionDrafts ?? {}); @@ -240,6 +242,7 @@ function createTransaction({ optimisticTransactionID, isTrackIntentUser, delegateAccountID, + formatPhoneNumber, }); } } diff --git a/src/libs/actions/IOU/MoneyRequestBuilder.ts b/src/libs/actions/IOU/MoneyRequestBuilder.ts index 434a9642728c..53df15b73bff 100644 --- a/src/libs/actions/IOU/MoneyRequestBuilder.ts +++ b/src/libs/actions/IOU/MoneyRequestBuilder.ts @@ -1,9 +1,10 @@ +import type {LocaleContextProps} from '@components/LocaleContextProvider'; + import DateUtils from '@libs/DateUtils'; import {getMicroSecondOnyxErrorObject, getMicroSecondOnyxErrorWithTranslationKey} from '@libs/ErrorUtils'; import {isLocalFile} from '@libs/fileDownload/FileUtils'; import type {MinimalTransaction} from '@libs/Formula'; import {updateIOUOwnerAndTotal} from '@libs/IOUUtils'; -import {formatPhoneNumber} from '@libs/LocalePhoneNumber'; import {translateLocal} from '@libs/Localize'; import {buildOptimisticNextStep} from '@libs/NextStepUtils'; import {rand64} from '@libs/NumberUtils'; @@ -190,6 +191,7 @@ type RequestMoneyInformation = { shouldDeferAutoSubmit?: boolean; delegateAccountID: number | undefined; isTrackIntentUser: boolean | undefined; + formatPhoneNumber: LocaleContextProps['formatPhoneNumber']; }; type MoneyRequestInformationParams = { @@ -225,6 +227,7 @@ type MoneyRequestInformationParams = { personalDetails: OnyxEntry; isTrackIntentUser: boolean | undefined; delegateAccountID: number | undefined; + formatPhoneNumber: LocaleContextProps['formatPhoneNumber']; }; type MoneyRequestOptimisticParams = { @@ -1267,6 +1270,7 @@ function getMoneyRequestInformation(moneyRequestInformation: MoneyRequestInforma betas, delegateAccountID, isTrackIntentUser, + formatPhoneNumber, } = moneyRequestInformation; const {payeeAccountID = currentUserAccountIDParam, payeeEmail = currentUserEmailParam, participant} = participantParams; const {policy, policyCategories, policyTagList, policyRecentlyUsedCategories, policyRecentlyUsedTags} = policyParams; diff --git a/src/libs/actions/IOU/Split.ts b/src/libs/actions/IOU/Split.ts index efef5ad1d75d..7bfcbaa49068 100644 --- a/src/libs/actions/IOU/Split.ts +++ b/src/libs/actions/IOU/Split.ts @@ -2178,6 +2178,7 @@ function createDistanceRequest(distanceRequestInformation: CreateDistanceRequest delegateAccountID, isTrackIntentUser, optimisticChatReportID, + formatPhoneNumber, }); onyxData = moneyRequestOnyxData; diff --git a/src/libs/actions/IOU/SplitTransactionUpdate.ts b/src/libs/actions/IOU/SplitTransactionUpdate.ts index bb9da85365a0..51236b73a736 100644 --- a/src/libs/actions/IOU/SplitTransactionUpdate.ts +++ b/src/libs/actions/IOU/SplitTransactionUpdate.ts @@ -1,3 +1,4 @@ +import type {LocaleContextProps} from '@components/LocaleContextProvider'; import type {SearchActionsContextValue, SearchStateContextValue} from '@components/Search/types'; import {write as apiWrite} from '@libs/API'; @@ -118,6 +119,7 @@ type UpdateSplitTransactionsParams = { isOffline: boolean; delegateAccountID: number | undefined; isTrackIntentUser: boolean | undefined; + formatPhoneNumber: LocaleContextProps['formatPhoneNumber']; }; /** @@ -198,6 +200,7 @@ function updateSplitTransactions({ isOffline, delegateAccountID, isTrackIntentUser, + formatPhoneNumber, }: UpdateSplitTransactionsParams) { const parentTransactionReport = getReportOrDraftReport(transactionReport?.parentReportID); // For selfDM-origin splits the caller can't resolve a real `expenseReport` (the draft/source @@ -660,6 +663,7 @@ function updateSplitTransactions({ personalDetails, delegateAccountID, isTrackIntentUser, + formatPhoneNumber, } as MoneyRequestInformationParams; if (isReverseSplitOperation) { @@ -774,6 +778,7 @@ function updateSplitTransactions({ personalDetails, delegateAccountID, isTrackIntentUser, + formatPhoneNumber, }); let updateMoneyRequestParamsOnyxData: OnyxData = {}; diff --git a/src/libs/actions/IOU/TrackExpense.ts b/src/libs/actions/IOU/TrackExpense.ts index e363d6c94dca..328b5dbb2b7e 100644 --- a/src/libs/actions/IOU/TrackExpense.ts +++ b/src/libs/actions/IOU/TrackExpense.ts @@ -1,5 +1,7 @@ import ReceiptGeneric from '@assets/images/receipt-generic.png'; +import type {LocaleContextProps} from '@components/LocaleContextProvider'; + import type {CurrencyListActionsContextType} from '@hooks/useCurrencyList'; import * as API from '@libs/API'; @@ -1662,6 +1664,7 @@ function requestMoney(requestMoneyInformation: RequestMoneyInformation): {iouRep shouldDeferAutoSubmit, delegateAccountID, isTrackIntentUser, + formatPhoneNumber, } = requestMoneyInformation; const {payeeAccountID} = participantParams; const parsedComment = getParsedComment(transactionParams.comment ?? ''); @@ -1772,6 +1775,7 @@ function requestMoney(requestMoneyInformation: RequestMoneyInformation): {iouRep personalDetails, delegateAccountID, isTrackIntentUser, + formatPhoneNumber, }); const activeReportID = isMoneyRequestReport ? report?.reportID : chatReport.reportID; @@ -1967,6 +1971,7 @@ function convertBulkTrackedExpensesToIOU({ selfDMReportActions, delegateAccountID, isTrackIntentUser, + formatPhoneNumber, }: { transactions: OnyxTypes.Transaction[]; iouReport: OnyxEntry; @@ -1983,6 +1988,7 @@ function convertBulkTrackedExpensesToIOU({ selfDMReportActions: OnyxEntry; delegateAccountID: number | undefined; isTrackIntentUser: boolean | undefined; + formatPhoneNumber: LocaleContextProps['formatPhoneNumber']; }) { const iouReportID = iouReport?.reportID; @@ -2103,6 +2109,7 @@ function convertBulkTrackedExpensesToIOU({ }, delegateAccountID, isTrackIntentUser, + formatPhoneNumber, }); const isDistanceRequest = isDistanceRequestTransactionUtils(transaction); diff --git a/src/pages/Share/SubmitDetailsPage.tsx b/src/pages/Share/SubmitDetailsPage.tsx index 722674c377d9..dcdfd80f550d 100644 --- a/src/pages/Share/SubmitDetailsPage.tsx +++ b/src/pages/Share/SubmitDetailsPage.tsx @@ -77,7 +77,7 @@ function SubmitDetailsPage({ }, }: ShareDetailsPageProps) { const styles = useThemeStyles(); - const {translate} = useLocalize(); + const {translate, formatPhoneNumber} = useLocalize(); const delegateAccountID = useDelegateAccountID(); const [unknownUserDetails] = useOnyx(ONYXKEYS.SHARE_UNKNOWN_USER_DETAILS); const [personalDetails] = useOnyx(`${ONYXKEYS.PERSONAL_DETAILS_LIST}`); @@ -376,6 +376,7 @@ function SubmitDetailsPage({ optimisticTransactionID, isTrackIntentUser, delegateAccountID, + formatPhoneNumber, }); } cleanupAndNavigateAfterExpenseCreate({ diff --git a/src/pages/iou/SplitExpensePage.tsx b/src/pages/iou/SplitExpensePage.tsx index 88219b69b040..479629f0a84d 100644 --- a/src/pages/iou/SplitExpensePage.tsx +++ b/src/pages/iou/SplitExpensePage.tsx @@ -89,7 +89,7 @@ const TAB_NAVIGATOR_HEIGHT_LANDSCAPE = variables.tabSelectorButtonHeight + varia function SplitExpensePage({route}: SplitExpensePageProps) { const styles = useThemeStyles(); - const {translate} = useLocalize(); + const {translate, formatPhoneNumber} = useLocalize(); const delegateAccountID = useDelegateAccountID(); const {reportID, transactionID, splitExpenseTransactionID, backTo} = route.params; @@ -400,6 +400,7 @@ function SplitExpensePage({route}: SplitExpensePageProps) { isOffline, delegateAccountID, isTrackIntentUser, + formatPhoneNumber, }); }; diff --git a/src/pages/iou/request/step/IOURequestStepAmount.tsx b/src/pages/iou/request/step/IOURequestStepAmount.tsx index 8b4043df52f4..099638f4d8d8 100644 --- a/src/pages/iou/request/step/IOURequestStepAmount.tsx +++ b/src/pages/iou/request/step/IOURequestStepAmount.tsx @@ -72,7 +72,7 @@ function IOURequestStepAmount({ transaction, shouldKeepUserInput = false, }: IOURequestStepAmountProps) { - const {translate} = useLocalize(); + const {translate, formatPhoneNumber} = useLocalize(); const {getCurrencyDecimals} = useCurrencyListActions(); const currentUserPersonalDetails = useCurrentUserPersonalDetails(); const [isCurrencyPickerVisible, setIsCurrencyPickerVisible] = useState(false); @@ -251,6 +251,7 @@ function IOURequestStepAmount({ navigateBack: saveAndNavigateBack, amount, paymentMethod, + formatPhoneNumber, isTrackIntentUser, policyTags, reportPolicyTags, diff --git a/src/pages/iou/request/step/IOURequestStepScan/components/ScanSkipConfirmation.tsx b/src/pages/iou/request/step/IOURequestStepScan/components/ScanSkipConfirmation.tsx index 7af6a2e499c5..5ba16ce8d102 100644 --- a/src/pages/iou/request/step/IOURequestStepScan/components/ScanSkipConfirmation.tsx +++ b/src/pages/iou/request/step/IOURequestStepScan/components/ScanSkipConfirmation.tsx @@ -304,6 +304,7 @@ function ScanSkipConfirmation({report, action, iouType, reportID, transactionID, currentUserLocalCurrency: currentUserPersonalDetails.localCurrencyCode ?? CONST.CURRENCY.USD, isTrackIntentUser, delegateAccountID, + formatPhoneNumber, }; const scanDestinationReportID = iouType === CONST.IOU.TYPE.TRACK ? (report?.reportID ?? selfDMReport?.reportID) : report?.reportID; diff --git a/src/pages/iou/request/step/confirmation/useExpenseSubmission.ts b/src/pages/iou/request/step/confirmation/useExpenseSubmission.ts index 2cccb6ed70a6..8ab081d5d813 100644 --- a/src/pages/iou/request/step/confirmation/useExpenseSubmission.ts +++ b/src/pages/iou/request/step/confirmation/useExpenseSubmission.ts @@ -539,6 +539,7 @@ function useExpenseSubmission(params: UseExpenseSubmissionParams) { personalDetails, isTrackIntentUser, delegateAccountID, + formatPhoneNumber, }); existingIOUReport = iouReport; if (!iouReport) { diff --git a/tests/actions/IOU/BuildOnyxDataForMoneyRequestTest.ts b/tests/actions/IOU/BuildOnyxDataForMoneyRequestTest.ts index 9517afe347c5..d6927f9c88fc 100644 --- a/tests/actions/IOU/BuildOnyxDataForMoneyRequestTest.ts +++ b/tests/actions/IOU/BuildOnyxDataForMoneyRequestTest.ts @@ -1,4 +1,4 @@ -import {buildOnyxDataForMoneyRequest} from '@libs/actions/IOU/MoneyRequestBuilder'; +import {buildOnyxDataForMoneyRequest, getMoneyRequestInformation} from '@libs/actions/IOU/MoneyRequestBuilder'; import {getOriginalMessage} from '@libs/ReportActionsUtils'; import type {OptimisticCreatedReportAction, OptimisticIOUReportAction} from '@libs/ReportUtils'; @@ -475,4 +475,41 @@ describe('buildOnyxDataForMoneyRequest', () => { expect((chatReportEntry?.value as Partial)?.iouReportID).toBeUndefined(); }); }); + + it('uses the injected formatter for optimistic new-chat personal detail display name', () => { + const mockFormatPhoneNumber = jest.fn((phoneNumber: string) => `formatted:${phoneNumber}`); + const result = getMoneyRequestInformation({ + parentChatReport: undefined, + participantParams: { + payeeAccountID: CURRENT_USER_ACCOUNT_ID, + payeeEmail: CURRENT_USER_EMAIL, + participant: { + accountID: PAYER_ACCOUNT_ID, + login: '+15551234567', + }, + }, + transactionParams: { + amount: 1000, + currency: CONST.CURRENCY.USD, + created: '2024-01-01', + merchant: 'Test Merchant', + }, + betas: [], + isASAPSubmitBetaEnabled: false, + currentUserAccountIDParam: CURRENT_USER_ACCOUNT_ID, + currentUserEmailParam: CURRENT_USER_EMAIL, + transactionViolations: {}, + quickAction: undefined, + policyRecentlyUsedCurrencies: [], + personalDetails: {}, + delegateAccountID: undefined, + isTrackIntentUser: false, + formatPhoneNumber: mockFormatPhoneNumber, + }); + + const personalDetailsEntry = result.onyxData.optimisticData?.find((entry) => entry.key === ONYXKEYS.PERSONAL_DETAILS_LIST); + + expect(mockFormatPhoneNumber).toHaveBeenCalledWith('+15551234567'); + expect((personalDetailsEntry?.value as Record)?.[PAYER_ACCOUNT_ID]?.displayName).toBe('formatted:+15551234567'); + }); }); diff --git a/tests/actions/IOU/GetMoneyRequestInformationTest.ts b/tests/actions/IOU/GetMoneyRequestInformationTest.ts index dd76fa00547b..4b256c9f2d1f 100644 --- a/tests/actions/IOU/GetMoneyRequestInformationTest.ts +++ b/tests/actions/IOU/GetMoneyRequestInformationTest.ts @@ -6,6 +6,7 @@ import type {Beta, PolicyTagLists, Report} from '@src/types/onyx'; import Onyx from 'react-native-onyx'; +import {formatPhoneNumber} from '../../utils/TestHelper'; import waitForBatchedUpdates from '../../utils/waitForBatchedUpdates'; jest.mock('@src/libs/Navigation/Navigation', () => ({ @@ -70,6 +71,7 @@ const baseParams = { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, } as const; describe('getMoneyRequestInformation', () => { diff --git a/tests/actions/IOU/RequestMoneyTest.ts b/tests/actions/IOU/RequestMoneyTest.ts index d914d34ca9c5..1d116a74e3fb 100644 --- a/tests/actions/IOU/RequestMoneyTest.ts +++ b/tests/actions/IOU/RequestMoneyTest.ts @@ -224,6 +224,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); return waitForBatchedUpdates() .then( @@ -485,6 +486,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); return waitForBatchedUpdates(); }) @@ -717,6 +719,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); } return waitForBatchedUpdates(); @@ -884,6 +887,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); return ( waitForBatchedUpdates() @@ -1403,6 +1407,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); expect(notifyNewAction).toHaveBeenCalledTimes(0); }); @@ -1438,6 +1443,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); expect(Navigation.setNavigationActionToMicrotaskQueue).toHaveBeenCalledTimes(1); }); @@ -1473,6 +1479,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); // Verify that the iouReport is created successfully when isSelfTourViewed is true expect(iouReport).toBeDefined(); @@ -1527,6 +1534,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -1574,6 +1582,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -1648,6 +1657,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); waitForBatchedUpdates(); @@ -1719,6 +1729,7 @@ describe('actions/IOU', () => { betas: [CONST.BETAS.ALL], delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); expect(iouReport).toBeDefined(); @@ -1795,6 +1806,7 @@ describe('actions/IOU', () => { betas: [CONST.BETAS.ALL], delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); expect(iouReport).toBeDefined(); @@ -1842,6 +1854,7 @@ describe('actions/IOU', () => { betas: [CONST.BETAS.ALL], delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); // Should still create the expense even with empty personalDetails @@ -2004,6 +2017,7 @@ describe('actions/IOU', () => { betas: [CONST.BETAS.ALL], delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -2081,6 +2095,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); return waitForBatchedUpdates(); }) @@ -2170,6 +2185,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); return waitForBatchedUpdates(); }) @@ -2250,6 +2266,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); return waitForBatchedUpdates(); }) @@ -2325,6 +2342,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); return waitForBatchedUpdates(); }) @@ -2401,6 +2419,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); return waitForBatchedUpdates(); }) @@ -2474,6 +2493,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: DELEGATE_ACCOUNT_ID, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -2537,6 +2557,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -2608,6 +2629,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -2668,6 +2690,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -2900,6 +2923,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -2971,6 +2995,7 @@ describe('actions/IOU', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -3098,6 +3123,7 @@ describe('actions/IOU', () => { optimisticChatReportID: undefined, currentUserLocalCurrency: 'USD', isTrackIntentUser: false, + formatPhoneNumber, delegateAccountID: undefined, }; }; diff --git a/tests/actions/IOU/SplitReportTotalsTest.ts b/tests/actions/IOU/SplitReportTotalsTest.ts index 2fa20449b66d..acaf32b66b8e 100644 --- a/tests/actions/IOU/SplitReportTotalsTest.ts +++ b/tests/actions/IOU/SplitReportTotalsTest.ts @@ -774,6 +774,7 @@ describe('actions/IOU', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, ...overrides, }; } diff --git a/tests/actions/IOUTest/CreateExpenseByTypeTest.ts b/tests/actions/IOUTest/CreateExpenseByTypeTest.ts index c444a4bb8c1b..d3fe9bd75135 100644 --- a/tests/actions/IOUTest/CreateExpenseByTypeTest.ts +++ b/tests/actions/IOUTest/CreateExpenseByTypeTest.ts @@ -17,6 +17,7 @@ import Onyx from 'react-native-onyx'; import currencyList from '../../unit/currencyList.json'; import {createRandomReport} from '../../utils/collections/reports'; import createRandomTransaction from '../../utils/collections/transaction'; +import {formatPhoneNumber} from '../../utils/TestHelper'; import waitForBatchedUpdates from '../../utils/waitForBatchedUpdates'; jest.mock('@libs/actions/IOU/TrackExpense', () => ({ @@ -132,6 +133,7 @@ describe('actions/IOU/createExpenseByType', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: undefined, + formatPhoneNumber, }; return {transaction, transactionDetails, params}; diff --git a/tests/actions/IOUTest/DeleteMoneyRequestTest.ts b/tests/actions/IOUTest/DeleteMoneyRequestTest.ts index 8abc64df6a6c..3dd6ec1308f8 100644 --- a/tests/actions/IOUTest/DeleteMoneyRequestTest.ts +++ b/tests/actions/IOUTest/DeleteMoneyRequestTest.ts @@ -34,7 +34,7 @@ import {createRandomReport} from '../../utils/collections/reports'; import createRandomTransaction from '../../utils/collections/transaction'; import getOnyxValue from '../../utils/getOnyxValue'; import PusherHelper from '../../utils/PusherHelper'; -import {getCurrencyDecimalsLocal, getGlobalFetchMock, getOnyxData, setPersonalDetails, signInWithTestUser} from '../../utils/TestHelper'; +import {formatPhoneNumber, getCurrencyDecimalsLocal, getGlobalFetchMock, getOnyxData, setPersonalDetails, signInWithTestUser} from '../../utils/TestHelper'; import waitForBatchedUpdates from '../../utils/waitForBatchedUpdates'; const topMostReportID = '23423423'; @@ -195,6 +195,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -446,6 +447,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -1141,6 +1143,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); } @@ -1226,6 +1229,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -1400,6 +1404,7 @@ describe('actions/IOU/DeleteMoneyRequest', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); } diff --git a/tests/actions/IOUTest/PayMoneyRequestTest.ts b/tests/actions/IOUTest/PayMoneyRequestTest.ts index e107649f55b1..59b125bcdd6b 100644 --- a/tests/actions/IOUTest/PayMoneyRequestTest.ts +++ b/tests/actions/IOUTest/PayMoneyRequestTest.ts @@ -35,7 +35,7 @@ import createRandomReportAction from '../../utils/collections/reportActions'; import {createRandomReport} from '../../utils/collections/reports'; import createRandomTransaction from '../../utils/collections/transaction'; import getOnyxValue from '../../utils/getOnyxValue'; -import {getGlobalFetchMock, getOnyxData, translateLocal} from '../../utils/TestHelper'; +import {formatPhoneNumber, getGlobalFetchMock, getOnyxData, translateLocal} from '../../utils/TestHelper'; import waitForBatchedUpdates from '../../utils/waitForBatchedUpdates'; const topMostReportID = '23423423'; @@ -167,6 +167,7 @@ describe('actions/IOU/PayMoneyRequest', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); return waitForBatchedUpdates() .then( @@ -436,6 +437,7 @@ describe('actions/IOU/PayMoneyRequest', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); } return waitForBatchedUpdates(); @@ -604,6 +606,7 @@ describe('actions/IOU/PayMoneyRequest', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); } return waitForBatchedUpdates(); @@ -1495,6 +1498,7 @@ describe('actions/IOU/PayMoneyRequest', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); } return waitForBatchedUpdates(); @@ -1624,6 +1628,7 @@ describe('actions/IOU/PayMoneyRequest', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); } await waitForBatchedUpdates(); @@ -1876,6 +1881,7 @@ describe('actions/IOU/PayMoneyRequest', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); } await waitForBatchedUpdates(); diff --git a/tests/actions/IOUTest/ReportWorkflowTest.ts b/tests/actions/IOUTest/ReportWorkflowTest.ts index e7eb16444c69..5cc4a792bceb 100644 --- a/tests/actions/IOUTest/ReportWorkflowTest.ts +++ b/tests/actions/IOUTest/ReportWorkflowTest.ts @@ -228,6 +228,7 @@ describe('actions/IOU/ReportWorkflow', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); } return waitForBatchedUpdates(); @@ -377,6 +378,7 @@ describe('actions/IOU/ReportWorkflow', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); } return waitForBatchedUpdates(); @@ -460,6 +462,7 @@ describe('actions/IOU/ReportWorkflow', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); } return waitForBatchedUpdates(); @@ -509,6 +512,7 @@ describe('actions/IOU/ReportWorkflow', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); } return waitForBatchedUpdates(); @@ -734,6 +738,7 @@ describe('actions/IOU/ReportWorkflow', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); } return waitForBatchedUpdates(); @@ -783,6 +788,7 @@ describe('actions/IOU/ReportWorkflow', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); } return waitForBatchedUpdates(); @@ -977,6 +983,7 @@ describe('actions/IOU/ReportWorkflow', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); } return waitForBatchedUpdates(); @@ -1184,6 +1191,7 @@ describe('actions/IOU/ReportWorkflow', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); } await waitForBatchedUpdates(); diff --git a/tests/actions/IOUTest/SplitSelfDMTest.ts b/tests/actions/IOUTest/SplitSelfDMTest.ts index 87ea4c971123..723fbebe61f1 100644 --- a/tests/actions/IOUTest/SplitSelfDMTest.ts +++ b/tests/actions/IOUTest/SplitSelfDMTest.ts @@ -20,7 +20,7 @@ import type {MockFetch} from '../../utils/TestHelper'; import createPersonalDetails from '../../utils/collections/personalDetails'; import {createSelfDM} from '../../utils/collections/reports'; import getOnyxValue from '../../utils/getOnyxValue'; -import {getGlobalFetchMock, getOnyxData} from '../../utils/TestHelper'; +import {formatPhoneNumber, getGlobalFetchMock, getOnyxData} from '../../utils/TestHelper'; import waitForBatchedUpdates from '../../utils/waitForBatchedUpdates'; import waitForNetworkPromises from '../../utils/waitForNetworkPromises'; @@ -217,6 +217,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow - selfDM', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -303,6 +304,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow - selfDM', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -409,6 +411,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow - selfDM', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -501,6 +504,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow - selfDM', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -561,6 +565,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow - selfDM', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -650,6 +655,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow - selfDM', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); diff --git a/tests/actions/IOUTest/SplitTest.ts b/tests/actions/IOUTest/SplitTest.ts index f01c7f5b2a93..ae06c9171857 100644 --- a/tests/actions/IOUTest/SplitTest.ts +++ b/tests/actions/IOUTest/SplitTest.ts @@ -1349,6 +1349,7 @@ describe('split expense', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -1878,6 +1879,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -1997,6 +1999,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -2128,6 +2131,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -2209,6 +2213,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -2294,6 +2299,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -2354,6 +2360,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -2435,6 +2442,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -2549,6 +2557,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -2611,6 +2620,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -2675,6 +2685,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -2747,6 +2758,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -2897,6 +2909,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -3038,6 +3051,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -3148,6 +3162,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -3280,6 +3295,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -3411,6 +3427,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -3531,6 +3548,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); } @@ -3673,6 +3691,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -3758,6 +3777,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -3863,6 +3883,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -4037,6 +4058,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -4171,6 +4193,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -4249,6 +4272,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); await getOnyxData({ @@ -4356,6 +4380,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -4427,6 +4452,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); await getOnyxData({ @@ -4534,6 +4560,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -4610,6 +4637,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -4726,6 +4754,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -4803,6 +4832,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -4940,6 +4970,7 @@ describe('updateSplitTransactionsFromSplitExpensesFlow', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -5059,6 +5090,7 @@ describe('updateSplitTransactions', () => { existingTransactionDraft: undefined, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -5126,6 +5158,7 @@ describe('updateSplitTransactions', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -5195,6 +5228,7 @@ describe('updateSplitTransactions', () => { draftTransactionIDs: [], delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -5262,6 +5296,7 @@ describe('updateSplitTransactions', () => { isOffline: true, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -5331,6 +5366,7 @@ describe('updateSplitTransactions', () => { existingTransactionDraft: undefined, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -5396,6 +5432,7 @@ describe('updateSplitTransactions', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -5478,6 +5515,7 @@ describe('updateSplitTransactions', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -5577,6 +5615,7 @@ describe('updateSplitTransactions', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -5643,6 +5682,7 @@ describe('updateSplitTransactions', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); const updateSplitTransactionCall = writeSpy.mock.calls.find(([command]) => command === WRITE_COMMANDS.UPDATE_SPLIT_TRANSACTION); @@ -5903,6 +5943,7 @@ describe('updateSplitTransactions', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -6016,6 +6057,7 @@ describe('updateSplitTransactions', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -6093,6 +6135,7 @@ describe('updateSplitTransactions', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -6163,6 +6206,7 @@ describe('updateSplitTransactions', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -6238,6 +6282,7 @@ describe('updateSplitTransactions', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -6308,6 +6353,7 @@ describe('updateSplitTransactions', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -6419,6 +6465,7 @@ describe('updateSplitTransactions', () => { isOffline: true, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); diff --git a/tests/actions/IOUTest/TrackExpenseTest.ts b/tests/actions/IOUTest/TrackExpenseTest.ts index 3998416ec3cf..1adcc326ae0e 100644 --- a/tests/actions/IOUTest/TrackExpenseTest.ts +++ b/tests/actions/IOUTest/TrackExpenseTest.ts @@ -2827,6 +2827,7 @@ describe('actions/IOU/TrackExpense', () => { selfDMReportActions: undefined, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); }).not.toThrow(); }); @@ -2901,6 +2902,7 @@ describe('actions/IOU/TrackExpense', () => { selfDMReportActions: undefined, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); }).not.toThrow(); }); @@ -2945,6 +2947,7 @@ describe('actions/IOU/TrackExpense', () => { selfDMReportActions: undefined, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); }).not.toThrow(); }); @@ -2989,6 +2992,7 @@ describe('actions/IOU/TrackExpense', () => { selfDMReportActions: undefined, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); }).not.toThrow(); }); diff --git a/tests/actions/TransactionTest.ts b/tests/actions/TransactionTest.ts index cef52b0277f2..fc9c86e42a01 100644 --- a/tests/actions/TransactionTest.ts +++ b/tests/actions/TransactionTest.ts @@ -36,7 +36,7 @@ import createPersonalDetails from '../utils/collections/personalDetails'; import createRandomPolicy from '../utils/collections/policies'; import {createRandomReport} from '../utils/collections/reports'; import getOnyxValue from '../utils/getOnyxValue'; -import {getGlobalFetchMock, getOnyxData} from '../utils/TestHelper'; +import {formatPhoneNumber, getGlobalFetchMock, getOnyxData} from '../utils/TestHelper'; import waitForBatchedUpdates from '../utils/waitForBatchedUpdates'; type LegacyChangeTransactionsReportProps = Omit< @@ -623,6 +623,7 @@ describe('actions/Transaction', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); await getOnyxData({ @@ -729,6 +730,7 @@ describe('actions/Transaction', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -801,6 +803,7 @@ describe('actions/Transaction', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); await getOnyxData({ @@ -907,6 +910,7 @@ describe('actions/Transaction', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -984,6 +988,7 @@ describe('actions/Transaction', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -1099,6 +1104,7 @@ describe('actions/Transaction', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -1177,6 +1183,7 @@ describe('actions/Transaction', () => { personalDetails: {}, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); @@ -1313,6 +1320,7 @@ describe('actions/Transaction', () => { isOffline: false, delegateAccountID: undefined, isTrackIntentUser: false, + formatPhoneNumber, }); await waitForBatchedUpdates(); diff --git a/tests/unit/IOUAmountSubmissionTest.ts b/tests/unit/IOUAmountSubmissionTest.ts index 7cddfcf710da..ed33a7007bdd 100644 --- a/tests/unit/IOUAmountSubmissionTest.ts +++ b/tests/unit/IOUAmountSubmissionTest.ts @@ -12,7 +12,7 @@ import Onyx from 'react-native-onyx'; import createRandomPolicy from '../utils/collections/policies'; import {createRandomReport} from '../utils/collections/reports'; -import {translateLocal} from '../utils/TestHelper'; +import {formatPhoneNumber, translateLocal} from '../utils/TestHelper'; import waitForBatchedUpdates from '../utils/waitForBatchedUpdates'; const CURRENT_USER_ACCOUNT_ID = 5; @@ -195,6 +195,7 @@ describe('AmountSubmission', () => { navigateBack: jest.fn(), amount: '10', paymentMethod: undefined, + formatPhoneNumber, allPersonalDetails: {}, allReports: {}, allReportDrafts: {},