From 05ed9f2a8812c81e19deed1e01b7eb79ae88bc44 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Mon, 16 Oct 2023 10:37:22 -0600 Subject: [PATCH] Rename const from MONEY_REQUEST_TYPE to TYPE --- src/CONST.ts | 2 +- src/ROUTES.ts | 2 +- .../MoneyRequestConfirmationList.js | 12 +++++------ src/components/ReportWelcomeText.js | 2 +- src/libs/IOUUtils.ts | 2 +- src/libs/MoneyRequestUtils.ts | 4 ++-- src/libs/ReportUtils.js | 6 +++--- src/libs/actions/IOU.js | 4 ++-- src/pages/EditRequestDistancePage.js | 2 +- .../AttachmentPickerWithMenuItems.js | 6 +++--- .../FloatingActionButtonAndPopover.js | 4 ++-- src/pages/iou/IOUCurrencySelection.js | 2 +- src/pages/iou/MoneyRequestSelectorPage.js | 8 ++++---- src/pages/iou/NewDistanceRequestPage.js | 2 +- src/pages/iou/SplitBillDetailsPage.js | 2 +- .../iou/steps/MoneyRequestConfirmPage.js | 14 ++++++------- .../MoneyRequestParticipantsPage.js | 6 +++--- .../MoneyRequestParticipantsSelector.js | 4 ++-- tests/actions/IOUTest.js | 6 +++--- tests/unit/ReportUtilsTest.js | 20 +++++++++---------- 20 files changed, 55 insertions(+), 55 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index b9e9181afd5b..4d355993039c 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1097,7 +1097,7 @@ const CONST = { EXPENSIFY: 'Expensify', VBBA: 'ACH', }, - MONEY_REQUEST_TYPE: { + TYPE: { SEND: 'send', SPLIT: 'split', REQUEST: 'request', diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 6219e545c8ca..66c0baf390f3 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -206,7 +206,7 @@ export default { getRoute: (reportID: string, accountID: string | number) => `r/${reportID}/notes/${accountID}/edit`, }, - // To see the available iouType, please refer to CONST.IOU.MONEY_REQUEST_TYPE + // To see the available iouType, please refer to CONST.IOU.TYPE MONEY_REQUEST: { route: ':iouType/new/:reportID?', getRoute: (iouType: string, reportID = '') => `${iouType}/new/${reportID}`, diff --git a/src/components/MoneyRequestConfirmationList.js b/src/components/MoneyRequestConfirmationList.js index 42fa1db48220..75695aef7514 100755 --- a/src/components/MoneyRequestConfirmationList.js +++ b/src/components/MoneyRequestConfirmationList.js @@ -171,7 +171,7 @@ const defaultProps = { onConfirm: () => {}, onSendMoney: () => {}, onSelectParticipant: () => {}, - iouType: CONST.IOU.MONEY_REQUEST_TYPE.REQUEST, + iouType: CONST.IOU.TYPE.REQUEST, iouCategory: '', iouTag: '', iouIsBillable: false, @@ -208,9 +208,9 @@ function MoneyRequestConfirmationList(props) { const {translate, toLocaleDigit} = useLocalize(); const transaction = props.isEditingSplitBill ? props.draftTransaction || props.transaction : props.transaction; - const isTypeRequest = props.iouType === CONST.IOU.MONEY_REQUEST_TYPE.REQUEST; - const isSplitBill = props.iouType === CONST.IOU.MONEY_REQUEST_TYPE.SPLIT; - const isTypeSend = props.iouType === CONST.IOU.MONEY_REQUEST_TYPE.SEND; + const isTypeRequest = props.iouType === CONST.IOU.TYPE.REQUEST; + const isSplitBill = props.iouType === CONST.IOU.TYPE.SPLIT; + const isTypeSend = props.iouType === CONST.IOU.TYPE.SEND; const isSplitWithScan = isSplitBill && props.isScanRequest; @@ -445,7 +445,7 @@ function MoneyRequestConfirmationList(props) { return; } - if (props.iouType === CONST.IOU.MONEY_REQUEST_TYPE.SEND) { + if (props.iouType === CONST.IOU.TYPE.SEND) { if (!paymentMethod) { return; } @@ -491,7 +491,7 @@ function MoneyRequestConfirmationList(props) { return; } - const shouldShowSettlementButton = props.iouType === CONST.IOU.MONEY_REQUEST_TYPE.SEND; + const shouldShowSettlementButton = props.iouType === CONST.IOU.TYPE.SEND; const shouldDisableButton = selectedParticipants.length === 0; const button = shouldShowSettlementButton ? ( diff --git a/src/components/ReportWelcomeText.js b/src/components/ReportWelcomeText.js index 7c8444a5d5b9..23a27682a7d4 100644 --- a/src/components/ReportWelcomeText.js +++ b/src/components/ReportWelcomeText.js @@ -133,7 +133,7 @@ function ReportWelcomeText(props) { ))} )} - {(moneyRequestOptions.includes(CONST.IOU.MONEY_REQUEST_TYPE.SEND) || moneyRequestOptions.includes(CONST.IOU.MONEY_REQUEST_TYPE.REQUEST)) && ( + {(moneyRequestOptions.includes(CONST.IOU.TYPE.SEND) || moneyRequestOptions.includes(CONST.IOU.TYPE.REQUEST)) && ( {props.translate('reportActionsView.usePlusButton')} )} diff --git a/src/libs/IOUUtils.ts b/src/libs/IOUUtils.ts index 2425211d16bc..d8a916d0dfb0 100644 --- a/src/libs/IOUUtils.ts +++ b/src/libs/IOUUtils.ts @@ -77,7 +77,7 @@ function isIOUReportPendingCurrencyConversion(iouReport: Report): boolean { * Checks if the iou type is one of request, send, or split. */ function isValidMoneyRequestType(iouType: string): boolean { - const moneyRequestType: string[] = [CONST.IOU.MONEY_REQUEST_TYPE.REQUEST, CONST.IOU.MONEY_REQUEST_TYPE.SPLIT, CONST.IOU.MONEY_REQUEST_TYPE.SEND]; + const moneyRequestType: string[] = [CONST.IOU.TYPE.REQUEST, CONST.IOU.TYPE.SPLIT, CONST.IOU.TYPE.SEND]; return moneyRequestType.includes(iouType); } diff --git a/src/libs/MoneyRequestUtils.ts b/src/libs/MoneyRequestUtils.ts index ffa765621110..420184973a34 100644 --- a/src/libs/MoneyRequestUtils.ts +++ b/src/libs/MoneyRequestUtils.ts @@ -78,8 +78,8 @@ function replaceAllDigits(text: string, convertFn: (char: string) => string): st /** * Check if distance request or not */ -function isDistanceRequest(iouType: ValueOf, selectedTab: ValueOf): boolean { - return iouType === CONST.IOU.MONEY_REQUEST_TYPE.REQUEST && selectedTab === CONST.TAB.DISTANCE; +function isDistanceRequest(iouType: ValueOf, selectedTab: ValueOf): boolean { + return iouType === CONST.IOU.TYPE.REQUEST && selectedTab === CONST.TAB.DISTANCE; } /** diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 0b7bbfd61461..3cc1848e965a 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -3441,17 +3441,17 @@ function getMoneyRequestOptions(report, reportParticipants) { (hasMultipleParticipants && !isPolicyExpenseChat(report) && !isMoneyRequestReport(report)) || (isControlPolicyExpenseChat(report) && report.isOwnPolicyExpenseChat) ) { - return [CONST.IOU.MONEY_REQUEST_TYPE.SPLIT]; + return [CONST.IOU.TYPE.SPLIT]; } // DM chats that only have 2 people will see the Send / Request money options. // IOU and open or processing expense reports should show the Request option. // Workspace chats should only see the Request money option or Split option in case of Control policies return [ - ...(canRequestMoney(report, participants) ? [CONST.IOU.MONEY_REQUEST_TYPE.REQUEST] : []), + ...(canRequestMoney(report, participants) ? [CONST.IOU.TYPE.REQUEST] : []), // Send money option should be visible only in DMs - ...(isChatReport(report) && !isPolicyExpenseChat(report) && hasSingleParticipantInReport ? [CONST.IOU.MONEY_REQUEST_TYPE.SEND] : []), + ...(isChatReport(report) && !isPolicyExpenseChat(report) && hasSingleParticipantInReport ? [CONST.IOU.TYPE.SEND] : []), ]; } diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js index 422dd8fbb03a..9be710288188 100644 --- a/src/libs/actions/IOU.js +++ b/src/libs/actions/IOU.js @@ -1106,7 +1106,7 @@ function createSplitsAndOnyxData(participants, currentUserLogin, currentUserAcco oneOnOneIOUReport.reportID, comment, '', - CONST.IOU.MONEY_REQUEST_TYPE.SPLIT, + CONST.IOU.TYPE.SPLIT, splitTransaction.transactionID, undefined, undefined, @@ -1641,7 +1641,7 @@ function completeSplitBill(chatReportID, reportAction, updatedTransaction, sessi oneOnOneIOUReport.reportID, updatedTransaction.comment.comment, updatedTransaction.modifiedCreated, - CONST.IOU.MONEY_REQUEST_TYPE.SPLIT, + CONST.IOU.TYPE.SPLIT, transactionID, updatedTransaction.modifiedMerchant, {...updatedTransaction.receipt, state: CONST.IOU.RECEIPT_STATE.OPEN}, diff --git a/src/pages/EditRequestDistancePage.js b/src/pages/EditRequestDistancePage.js index f5beba5fdcfd..4eb7340dd410 100644 --- a/src/pages/EditRequestDistancePage.js +++ b/src/pages/EditRequestDistancePage.js @@ -29,7 +29,7 @@ const propTypes = { /** Parameters the route gets */ params: PropTypes.shape({ /** Type of IOU */ - iouType: PropTypes.oneOf(_.values(CONST.IOU.MONEY_REQUEST_TYPE)), + iouType: PropTypes.oneOf(_.values(CONST.IOU.TYPE)), /** Id of the report on which the distance request is being created */ reportID: PropTypes.string, diff --git a/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.js b/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.js index 4024cbd7a2c8..6522bedc825a 100644 --- a/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.js +++ b/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.js @@ -126,15 +126,15 @@ function AttachmentPickerWithMenuItems({ */ const moneyRequestOptions = useMemo(() => { const options = { - [CONST.IOU.MONEY_REQUEST_TYPE.SPLIT]: { + [CONST.IOU.TYPE.SPLIT]: { icon: Expensicons.Receipt, text: translate('iou.splitBill'), }, - [CONST.IOU.MONEY_REQUEST_TYPE.REQUEST]: { + [CONST.IOU.TYPE.REQUEST]: { icon: Expensicons.MoneyCircle, text: translate('iou.requestMoney'), }, - [CONST.IOU.MONEY_REQUEST_TYPE.SEND]: { + [CONST.IOU.TYPE.SEND]: { icon: Expensicons.Send, text: translate('iou.sendMoney'), }, diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js index c87d4f06e1f4..02f1856c7bf5 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js @@ -199,12 +199,12 @@ function FloatingActionButtonAndPopover(props) { { icon: Expensicons.MoneyCircle, text: props.translate('iou.requestMoney'), - onSelected: () => interceptAnonymousUser(() => IOU.startMoneyRequest(CONST.IOU.MONEY_REQUEST_TYPE.REQUEST)), + onSelected: () => interceptAnonymousUser(() => IOU.startMoneyRequest(CONST.IOU.TYPE.REQUEST)), }, { icon: Expensicons.Send, text: props.translate('iou.sendMoney'), - onSelected: () => interceptAnonymousUser(() => IOU.startMoneyRequest(CONST.IOU.MONEY_REQUEST_TYPE.SEND)), + onSelected: () => interceptAnonymousUser(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SEND)), }, ...(Permissions.canUseTasks(props.betas) ? [ diff --git a/src/pages/iou/IOUCurrencySelection.js b/src/pages/iou/IOUCurrencySelection.js index cd14dcd25f11..976bc2347d89 100644 --- a/src/pages/iou/IOUCurrencySelection.js +++ b/src/pages/iou/IOUCurrencySelection.js @@ -72,7 +72,7 @@ function IOUCurrencySelection(props) { const [searchValue, setSearchValue] = useState(''); const optionsSelectorRef = useRef(); const selectedCurrencyCode = (lodashGet(props.route, 'params.currency', props.iou.currency) || CONST.CURRENCY.USD).toUpperCase(); - const iouType = lodashGet(props.route, 'params.iouType', CONST.IOU.MONEY_REQUEST_TYPE.REQUEST); + const iouType = lodashGet(props.route, 'params.iouType', CONST.IOU.TYPE.REQUEST); const reportID = lodashGet(props.route, 'params.reportID', ''); const confirmCurrencySelection = useCallback( diff --git a/src/pages/iou/MoneyRequestSelectorPage.js b/src/pages/iou/MoneyRequestSelectorPage.js index d006e3480a4e..0786faa3841b 100644 --- a/src/pages/iou/MoneyRequestSelectorPage.js +++ b/src/pages/iou/MoneyRequestSelectorPage.js @@ -56,9 +56,9 @@ function MoneyRequestSelectorPage(props) { const {translate} = useLocalize(); const title = { - [CONST.IOU.MONEY_REQUEST_TYPE.REQUEST]: translate('iou.requestMoney'), - [CONST.IOU.MONEY_REQUEST_TYPE.SEND]: translate('iou.sendMoney'), - [CONST.IOU.MONEY_REQUEST_TYPE.SPLIT]: translate('iou.splitBill'), + [CONST.IOU.TYPE.REQUEST]: translate('iou.requestMoney'), + [CONST.IOU.TYPE.SEND]: translate('iou.sendMoney'), + [CONST.IOU.TYPE.SPLIT]: translate('iou.splitBill'), }; const isFromGlobalCreate = !reportID; const isExpenseRequest = ReportUtils.isPolicyExpenseChat(props.report); @@ -99,7 +99,7 @@ function MoneyRequestSelectorPage(props) { title={title[iouType]} onBackButtonPress={Navigation.dismissModal} /> - {iouType === CONST.IOU.MONEY_REQUEST_TYPE.REQUEST || iouType === CONST.IOU.MONEY_REQUEST_TYPE.SPLIT ? ( + {iouType === CONST.IOU.TYPE.REQUEST || iouType === CONST.IOU.TYPE.SPLIT ? ( ReportUtils.isPolicyExpenseChat(ReportUtils.getRootParentReport(props.report)), [props.report]); - const isManualRequestDM = props.selectedTab === CONST.TAB.MANUAL && iouType.current === CONST.IOU.MONEY_REQUEST_TYPE.REQUEST; + const isManualRequestDM = props.selectedTab === CONST.TAB.MANUAL && iouType.current === CONST.IOU.TYPE.REQUEST; useEffect(() => { IOU.resetMoneyRequestCategory(); @@ -195,7 +195,7 @@ function MoneyRequestConfirmPage(props) { const trimmedComment = props.iou.comment.trim(); // If we have a receipt let's start the split bill by creating only the action, the transaction, and the group DM if needed - if (iouType.current === CONST.IOU.MONEY_REQUEST_TYPE.SPLIT && props.iou.receiptPath) { + if (iouType.current === CONST.IOU.TYPE.SPLIT && props.iou.receiptPath) { const existingSplitChatReportID = CONST.REGEX.NUMBER.test(reportID.current) ? reportID.current : ''; FileUtils.readFileAsync(props.iou.receiptPath, props.iou.receiptFilename).then((receipt) => { IOU.startSplitBill( @@ -212,7 +212,7 @@ function MoneyRequestConfirmPage(props) { // IOUs created from a group report will have a reportID param in the route. // Since the user is already viewing the report, we don't need to navigate them to the report - if (iouType.current === CONST.IOU.MONEY_REQUEST_TYPE.SPLIT && CONST.REGEX.NUMBER.test(reportID.current)) { + if (iouType.current === CONST.IOU.TYPE.SPLIT && CONST.REGEX.NUMBER.test(reportID.current)) { IOU.splitBill( selectedParticipants, props.currentUserPersonalDetails.login, @@ -227,7 +227,7 @@ function MoneyRequestConfirmPage(props) { } // If the request is created from the global create menu, we also navigate the user to the group report - if (iouType.current === CONST.IOU.MONEY_REQUEST_TYPE.SPLIT) { + if (iouType.current === CONST.IOU.TYPE.SPLIT) { IOU.splitBillAndOpenReport( selectedParticipants, props.currentUserPersonalDetails.login, @@ -300,11 +300,11 @@ function MoneyRequestConfirmPage(props) { return props.translate('common.distance'); } - if (iouType.current === CONST.IOU.MONEY_REQUEST_TYPE.SPLIT) { + if (iouType.current === CONST.IOU.TYPE.SPLIT) { return props.translate('iou.split'); } - if (iouType.current === CONST.IOU.MONEY_REQUEST_TYPE.SEND) { + if (iouType.current === CONST.IOU.TYPE.SEND) { return props.translate('common.send'); } @@ -333,7 +333,7 @@ function MoneyRequestConfirmPage(props) { /> { @@ -121,7 +121,7 @@ function MoneyRequestParticipantsPage({iou, selectedTab, route}) { participants={iou.participants} onAddParticipants={IOU.setMoneyRequestParticipants} navigateToRequest={() => navigateToConfirmationStep(iouType.current)} - navigateToSplit={() => navigateToConfirmationStep(CONST.IOU.MONEY_REQUEST_TYPE.SPLIT)} + navigateToSplit={() => navigateToConfirmationStep(CONST.IOU.TYPE.SPLIT)} safeAreaPaddingBottomStyle={safeAreaPaddingBottomStyle} iouType={iouType.current} isDistanceRequest={isDistanceRequest} diff --git a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js index 547d2b7c363a..4571af34ddee 100755 --- a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js +++ b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js @@ -223,7 +223,7 @@ function MoneyRequestParticipantsSelector({ // If we are using this component in the "Request money" flow then we pass the includeOwnedWorkspaceChats argument so that the current user // sees the option to request money from their admin on their own Workspace Chat. - iouType === CONST.IOU.MONEY_REQUEST_TYPE.REQUEST, + iouType === CONST.IOU.TYPE.REQUEST, // We don't want to include any P2P options like personal details or reports that are not workspace chats for certain features. !isDistanceRequest, @@ -240,7 +240,7 @@ function MoneyRequestParticipantsSelector({ // the app from crashing on native when you try to do this, we'll going to hide the button if you have a workspace and other participants const hasPolicyExpenseChatParticipant = _.some(participants, (participant) => participant.isPolicyExpenseChat); const shouldShowConfirmButton = !(participants.length > 1 && hasPolicyExpenseChatParticipant); - const isAllowedToSplit = !isDistanceRequest && iouType !== CONST.IOU.MONEY_REQUEST_TYPE.SEND; + const isAllowedToSplit = !isDistanceRequest && iouType !== CONST.IOU.TYPE.SEND; return ( 0 ? safeAreaPaddingBottomStyle : {}]}> diff --git a/tests/actions/IOUTest.js b/tests/actions/IOUTest.js index 63fd7a0dd78b..bc302f5f1a88 100644 --- a/tests/actions/IOUTest.js +++ b/tests/actions/IOUTest.js @@ -1104,9 +1104,9 @@ describe('actions/IOU', () => { `Split bill with ${RORY_EMAIL}, ${CARLOS_EMAIL}, ${JULES_EMAIL}, and ${VIT_EMAIL} [${DateUtils.getDBTime().slice(0, 10)}]`, ); - expect(carlosTransaction.comment.source).toBe(CONST.IOU.MONEY_REQUEST_TYPE.SPLIT); - expect(julesTransaction.comment.source).toBe(CONST.IOU.MONEY_REQUEST_TYPE.SPLIT); - expect(vitTransaction.comment.source).toBe(CONST.IOU.MONEY_REQUEST_TYPE.SPLIT); + expect(carlosTransaction.comment.source).toBe(CONST.IOU.TYPE.SPLIT); + expect(julesTransaction.comment.source).toBe(CONST.IOU.TYPE.SPLIT); + expect(vitTransaction.comment.source).toBe(CONST.IOU.TYPE.SPLIT); expect(carlosTransaction.comment.originalTransactionID).toBe(groupTransaction.transactionID); expect(julesTransaction.comment.originalTransactionID).toBe(groupTransaction.transactionID); diff --git a/tests/unit/ReportUtilsTest.js b/tests/unit/ReportUtilsTest.js index c6afde7d9161..6d3aba1fd9ad 100644 --- a/tests/unit/ReportUtilsTest.js +++ b/tests/unit/ReportUtilsTest.js @@ -408,7 +408,7 @@ describe('ReportUtils', () => { chatType, }; const moneyRequestOptions = ReportUtils.getMoneyRequestOptions(report, [currentUserAccountID, participantsAccountIDs[0]], []); - return moneyRequestOptions.length === 1 && moneyRequestOptions.includes(CONST.IOU.MONEY_REQUEST_TYPE.SPLIT); + return moneyRequestOptions.length === 1 && moneyRequestOptions.includes(CONST.IOU.TYPE.SPLIT); }, ); expect(onlyHaveSplitOption).toBe(true); @@ -421,7 +421,7 @@ describe('ReportUtils', () => { }; const moneyRequestOptions = ReportUtils.getMoneyRequestOptions(report, [currentUserAccountID, ...participantsAccountIDs], []); expect(moneyRequestOptions.length).toBe(1); - expect(moneyRequestOptions.includes(CONST.IOU.MONEY_REQUEST_TYPE.SPLIT)).toBe(true); + expect(moneyRequestOptions.includes(CONST.IOU.TYPE.SPLIT)).toBe(true); }); it('user has send money permission', () => { @@ -431,7 +431,7 @@ describe('ReportUtils', () => { }; const moneyRequestOptions = ReportUtils.getMoneyRequestOptions(report, [currentUserAccountID, ...participantsAccountIDs], [CONST.BETAS.IOU_SEND]); expect(moneyRequestOptions.length).toBe(1); - expect(moneyRequestOptions.includes(CONST.IOU.MONEY_REQUEST_TYPE.SPLIT)).toBe(true); + expect(moneyRequestOptions.includes(CONST.IOU.TYPE.SPLIT)).toBe(true); }); it("it's a group chat report", () => { @@ -442,7 +442,7 @@ describe('ReportUtils', () => { }; const moneyRequestOptions = ReportUtils.getMoneyRequestOptions(report, [currentUserAccountID, ...participantsAccountIDs], [CONST.BETAS.IOU_SEND]); expect(moneyRequestOptions.length).toBe(1); - expect(moneyRequestOptions.includes(CONST.IOU.MONEY_REQUEST_TYPE.SPLIT)).toBe(true); + expect(moneyRequestOptions.includes(CONST.IOU.TYPE.SPLIT)).toBe(true); }); }); @@ -455,7 +455,7 @@ describe('ReportUtils', () => { }; const moneyRequestOptions = ReportUtils.getMoneyRequestOptions(report, [currentUserAccountID, ...participantsAccountIDs], [CONST.BETAS.IOU_SEND]); expect(moneyRequestOptions.length).toBe(1); - expect(moneyRequestOptions.includes(CONST.IOU.MONEY_REQUEST_TYPE.REQUEST)).toBe(true); + expect(moneyRequestOptions.includes(CONST.IOU.TYPE.REQUEST)).toBe(true); }); it("it is an expense report tied to user's own policy expense chat", () => { @@ -471,7 +471,7 @@ describe('ReportUtils', () => { }; const moneyRequestOptions = ReportUtils.getMoneyRequestOptions(report, [currentUserAccountID], [CONST.BETAS.IOU_SEND]); expect(moneyRequestOptions.length).toBe(1); - expect(moneyRequestOptions.includes(CONST.IOU.MONEY_REQUEST_TYPE.REQUEST)).toBe(true); + expect(moneyRequestOptions.includes(CONST.IOU.TYPE.REQUEST)).toBe(true); }); }); @@ -485,7 +485,7 @@ describe('ReportUtils', () => { }; const moneyRequestOptions = ReportUtils.getMoneyRequestOptions(report, [currentUserAccountID, participantsAccountIDs[0]], []); expect(moneyRequestOptions.length).toBe(1); - expect(moneyRequestOptions.includes(CONST.IOU.MONEY_REQUEST_TYPE.REQUEST)).toBe(true); + expect(moneyRequestOptions.includes(CONST.IOU.TYPE.REQUEST)).toBe(true); }); it('it is an IOU report in submitted state even with send money permissions', () => { @@ -498,7 +498,7 @@ describe('ReportUtils', () => { }; const moneyRequestOptions = ReportUtils.getMoneyRequestOptions(report, [currentUserAccountID, participantsAccountIDs[0]], [CONST.BETAS.IOU_SEND]); expect(moneyRequestOptions.length).toBe(1); - expect(moneyRequestOptions.includes(CONST.IOU.MONEY_REQUEST_TYPE.REQUEST)).toBe(true); + expect(moneyRequestOptions.includes(CONST.IOU.TYPE.REQUEST)).toBe(true); }); }); @@ -509,8 +509,8 @@ describe('ReportUtils', () => { }; const moneyRequestOptions = ReportUtils.getMoneyRequestOptions(report, [currentUserAccountID, participantsAccountIDs[0]], [CONST.BETAS.IOU_SEND]); expect(moneyRequestOptions.length).toBe(2); - expect(moneyRequestOptions.includes(CONST.IOU.MONEY_REQUEST_TYPE.REQUEST)).toBe(true); - expect(moneyRequestOptions.includes(CONST.IOU.MONEY_REQUEST_TYPE.SEND)).toBe(true); + expect(moneyRequestOptions.includes(CONST.IOU.TYPE.REQUEST)).toBe(true); + expect(moneyRequestOptions.includes(CONST.IOU.TYPE.SEND)).toBe(true); }); });