Skip to content

[HOLD] Clean up SettlementButton #79387

Backlog
0 of 2 issues completed
Backlog

Description

@roryabraham

HOLD #89237

Coming from #78915...

Problem

The SettlementButton component is quite complex (and important!), and I struggled to review changes made to part of it due to its complexity.

Solution

Let's clean up this important component! In order:

  1. Add automated UI tests covering the business logic for this component. customText and secondLineText alone have many permutations of conditions and expected results. These can be captured and documented by automated tests, which will help developers understand this component and more confidently make changes.
  2. Remove manual memoization to make it compile with React Compiler. There are 25 instances of this warning:
This component hasn't been memoized by React Compiler.
Reason: Existing memoization could not be preserved

This manual memoization is making the component more complex and longer.

  1. (exploration needed) Break it down into smaller, distinct components (by report type?) (i.e: using composition). It looks like there's significant differences in behavior for invoices vs expense reports vs IOU reports. Rather than having all three wrapped up in one component, let's DRY the common parts into a shared hook and keep the other parts separate, using the correct component for each type.

Sub-issues

Sub-issues

0 of 2 Issues completed
Loading 2 sub-issues

Activity

  1. self-assigned this
    on Jan 12, 2026
  2. added
    External
    Daily
    Bug
    on Jan 12, 2026
  3. added
    Help Wanted
    on Jan 12, 2026
  4. melvin-bot commented on Jan 12, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia (External)

  5. melvin-bot commented on Jan 12, 2026

    @melvin-bot

    Triggered auto assignment to @stephanieelliott (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  6. roryabraham commented on Jan 12, 2026

    @roryabraham
    ContributorAuthor

    The primary goal/requirement of this issue is Test Coverage - the other refactorings are kind of a bonus and secondary to the tests.

  7. abbasifaizan70 commented on Jan 12, 2026

    @abbasifaizan70
  8. roryabraham commented on Jan 12, 2026

    @roryabraham
    ContributorAuthor

    @abbasifaizan70 your proposal focuses too much on one specific aspect of this component (background highlight color). While I'm glad you found a bug, I'd suggest that you report it separately or incorporate it into a more comprehensive proposal to add test coverage and clean up the implementation of SettlementButton

  9. roryabraham commented on Jan 12, 2026

    @roryabraham
    ContributorAuthor

    Interestingly, your proposal doesn't actually even target the same component referenced in the issue description, so I'm going to mark it as off-topic

  10. TaduJR commented on Jan 12, 2026

    @TaduJR
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2026-01-12 21:03:56 UTC.

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    The SettlementButton component has 0% test coverage, 25 React Compiler warnings, and complex conditional logic that is difficult to review and maintain.

    What is the root cause of that problem?

    The customText and secondLineText props have complex conditional logic with many branches that lack test coverage. Additionally, paymentButtonOptions contains ~200 lines of business logic determining which payment options appear.

    getCustomText() decision tree (3 branches):

    const getCustomText = () => {
    if (shouldUseShortForm) {
    return translate('iou.pay');
    }
    if (lastPaymentMethod === CONST.IOU.PAYMENT_TYPE.ELSEWHERE) {
    return translate('iou.payElsewhere', {formattedAmount});
    }
    return translate('iou.settlePayment', {formattedAmount});
    };

    Condition Result
    shouldUseShortForm 'iou.pay'
    lastPaymentMethod === ELSEWHERE 'iou.payElsewhere'
    default 'iou.settlePayment'

    getSecondaryText() decision tree:

    const getSecondaryText = (): string | undefined => {
    if (
    shouldUseShortForm ||
    lastPaymentMethod === CONST.IOU.PAYMENT_TYPE.ELSEWHERE ||
    (paymentButtonOptions.length === 1 && paymentButtonOptions.every((option) => option.value === CONST.IOU.PAYMENT_TYPE.ELSEWHERE)) ||
    (shouldHidePaymentOptions && (shouldShowApproveButton || onlyShowPayElsewhere))
    ) {
    return undefined;
    }
    if (lastPaymentPolicy) {
    return lastPaymentPolicy.name;
    }
    const bankAccountToDisplay = hasIntentToPay
    ? ((formattedPaymentMethods.find((method) => method.methodID === policy?.achAccount?.bankAccountID) ?? formattedPaymentMethods.at(0)) as BankAccount)
    : bankAccount;
    if (lastPaymentMethod === CONST.IOU.PAYMENT_TYPE.EXPENSIFY || (hasIntentToPay && (isExpenseReport || isInvoiceReport))) {
    if (isInvoiceReport) {
    const isBusinessBankAccount = bankAccountToDisplay?.accountData?.type === CONST.BANK_ACCOUNT.TYPE.BUSINESS;
    return translate(isBusinessBankAccount ? 'iou.invoiceBusinessBank' : 'iou.invoicePersonalBank', bankAccountToDisplay?.accountData?.accountNumber?.slice(-4) ?? '');
    }
    if (!personalBankAccountList.length) {
    return;
    }
    return translate('common.wallet');
    }
    if ((lastPaymentMethod === CONST.IOU.PAYMENT_TYPE.VBBA || hasIntentToPay) && !!policy?.achAccount) {
    if (policy?.achAccount?.accountNumber) {
    return translate('paymentMethodList.bankAccountLastFour', policy?.achAccount?.accountNumber?.slice(-4));
    }
    if (!bankAccountToDisplay?.accountData?.accountNumber) {
    return;
    }
    return translate('paymentMethodList.bankAccountLastFour', bankAccountToDisplay?.accountData?.accountNumber?.slice(-4));
    }
    if (bankAccount?.accountData?.type === CONST.BANK_ACCOUNT.TYPE.BUSINESS && bankAccount?.methodID === policy?.achAccount?.bankAccountID && isExpenseReportUtil(iouReport)) {
    return translate('paymentMethodList.bankAccountLastFour', bankAccount?.accountData?.accountNumber?.slice(-4) ?? '');
    }
    return undefined;
    };

    # Condition Result
    1 shouldUseShortForm undefined
    2 lastPaymentMethod === ELSEWHERE undefined
    3 Only ELSEWHERE options available undefined
    4 shouldHidePaymentOptions && (shouldShowApproveButton || onlyShowPayElsewhere) undefined
    5 lastPaymentPolicy exists lastPaymentPolicy.name
    6 (EXPENSIFY || hasIntentToPay) && isInvoiceReport + Business bank 'iou.invoiceBusinessBank'
    7 (EXPENSIFY || hasIntentToPay) && isInvoiceReport + Personal bank 'iou.invoicePersonalBank'
    8 (EXPENSIFY || hasIntentToPay) && (isExpenseReport || isInvoiceReport) + no personal banks undefined
    9 (EXPENSIFY || hasIntentToPay) && (isExpenseReport || isInvoiceReport) + has personal banks 'common.wallet'
    10 lastPaymentMethod === EXPENSIFY + IOU report + has personal banks 'common.wallet'
    11 (VBBA || hasIntentToPay) && policy.achAccount.accountNumber 'bankAccountLastFour' (policy)
    12 (VBBA || hasIntentToPay) && policy.achAccount + no display account undefined
    13 (VBBA || hasIntentToPay) && policy.achAccount + has display account 'bankAccountLastFour' (display)
    14 Business bank + matches policy + isExpenseReport 'bankAccountLastFour'
    15 default undefined

    paymentButtonOptions key conditions:

    const paymentButtonOptions = useMemo(() => {
    const buttonOptions: Array<DropdownOption<string>> = [];
    const shortFormPayElsewhereButton = {
    text: translate('iou.pay'),
    icon: icons.CheckCircle,
    value: CONST.IOU.PAYMENT_TYPE.ELSEWHERE,
    shouldUpdateSelectedIndex: false,
    };
    const approveButtonOption = {
    text: translate('iou.approve', {formattedAmount}),
    icon: icons.ThumbsUp,
    value: CONST.IOU.REPORT_ACTION_TYPE.APPROVE,
    disabled: !!shouldDisableApproveButton,
    };
    const canUseWallet = !isExpenseReport && !isInvoiceReport && isCurrencySupportedForGlobalReimbursement(currency as CurrencyType);
    const canUseBusinessBankAccount = isExpenseReport || (isIOUReport(iouReport) && reportID && !hasRequestFromCurrentAccount(reportID, accountID ?? CONST.DEFAULT_NUMBER_ID));
    const canUsePersonalBankAccount = shouldShowPersonalBankAccountOption || isIOUReport(iouReport);
    const isPersonalOnlyOption = canUsePersonalBankAccount && !canUseBusinessBankAccount;
    // Only show the Approve button if the user cannot pay the expense
    if (shouldHidePaymentOptions && shouldShowApproveButton) {
    return [approveButtonOption];
    }
    if (onlyShowPayElsewhere) {
    return [shouldUseShortForm ? shortFormPayElsewhereButton : paymentMethods[CONST.IOU.PAYMENT_TYPE.ELSEWHERE]];
    }
    // To achieve the one tap pay experience we need to choose the correct payment type as default.
    if (canUseWallet) {
    if (personalBankAccountList.length && canUsePersonalBankAccount) {
    buttonOptions.push({
    text: translate('iou.settleWallet', {formattedAmount: ''}),
    value: CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT,
    icon: icons.Wallet,
    });
    } else if (canUsePersonalBankAccount) {
    buttonOptions.push(paymentMethods[CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT]);
    }
    if (activeAdminPolicies.length === 0 && !isPersonalOnlyOption) {
    buttonOptions.push(paymentMethods[CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT]);
    }
    }
    const shouldShowBusinessBankAccountOptions = isExpenseReport && shouldShowPayWithExpensifyOption && !isPersonalOnlyOption;
    if (shouldShowBusinessBankAccountOptions) {
    if (!isEmpty(latestBankItem) && latestBankItem) {
    buttonOptions.push({
    text: latestBankItem.at(0)?.text ?? '',
    icon: latestBankItem.at(0)?.icon,
    additionalIconStyles: latestBankItem.at(0)?.iconStyles,
    iconWidth: latestBankItem.at(0)?.iconSize,
    iconHeight: latestBankItem.at(0)?.iconSize,
    value: CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT,
    description: latestBankItem.at(0)?.description,
    });
    } else {
    buttonOptions.push(paymentMethods[CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT]);
    }
    }
    if ((hasMultiplePolicies || hasSinglePolicy) && canUseWallet && !isPersonalOnlyOption) {
    for (const p of activeAdminPolicies) {
    const policyName = p.name;
    buttonOptions.push({
    text: translate('iou.payWithPolicy', {policyName: truncate(policyName, {length: CONST.ADDITIONAL_ALLOWED_CHARACTERS}), formattedAmount: ''}),
    icon: icons.Building,
    value: p.id,
    shouldUpdateSelectedIndex: false,
    });
    }
    }
    if (shouldShowPayElsewhereOption) {
    buttonOptions.push({
    ...paymentMethods[CONST.IOU.PAYMENT_TYPE.ELSEWHERE],
    ...(!buttonOptions.length && shouldUseShortForm ? {text: translate('iou.pay')} : {}),
    });
    }
    if (isInvoiceReport) {
    const isCurrencySupported = isCurrencySupportedForGlobalReimbursement(currency as CurrencyType);
    const hasActivePolicyAsAdmin = !!activePolicy && isPolicyAdmin(activePolicy) && isPaidGroupPolicy(activePolicy);
    const isActivePolicyCurrencySupported = isCurrencySupportedForDirectReimbursement(activePolicy?.outputCurrency ?? '');
    const isUserCurrencySupported = isCurrencySupportedForDirectReimbursement(personalPolicy?.outputCurrency ?? CONST.CURRENCY.USD);
    const isInvoiceReceiverPolicyCurrencySupported = isCurrencySupportedForDirectReimbursement(invoiceReceiverPolicy?.outputCurrency ?? '');
    const canUseActivePolicy = hasActivePolicyAsAdmin && isActivePolicyCurrencySupported;
    // For business invoice receivers, we use the receiver policy to pay, so validate the receiver policy's currency
    // For individual receivers, allow if user has an active admin policy with supported currency OR user's local currency is supported
    const isPolicyCurrencySupported = invoiceReceiverPolicy ? isInvoiceReceiverPolicyCurrencySupported : canUseActivePolicy || isUserCurrencySupported;
    const getInvoicesOptions = (payAsBusiness: boolean) => {
    const getPolicyID = () => {
    if (chatReport?.invoiceReceiver?.type === CONST.REPORT.INVOICE_RECEIVER_TYPE.BUSINESS) {
    return chatReport?.invoiceReceiver?.policyID;
    }
    if (canUseActivePolicy) {
    return activePolicy.id;
    }
    return createWorkspace({
    introSelected,
    activePolicyID,
    currentUserAccountIDParam: currentUserPersonalDetails.accountID,
    currentUserEmailParam: currentUserPersonalDetails.email ?? '',
    }).policyID;
    };
    const addBankAccountItem = {
    text: translate('bankAccount.addBankAccount'),
    icon: icons.Bank,
    onSelected: () => {
    if (payAsBusiness) {
    navigateToBankAccountRoute(getPolicyID());
    } else {
    Navigation.navigate(ROUTES.SETTINGS_ADD_BANK_ACCOUNT.route);
    }
    },
    value: CONST.IOU.PAYMENT_TYPE.ELSEWHERE,
    };
    return [
    ...(isCurrencySupported ? getPaymentSubitems(payAsBusiness) : []),
    ...(isCurrencySupported && isPolicyCurrencySupported ? [addBankAccountItem] : []),
    {
    text: translate('iou.payElsewhere', {formattedAmount: ''}),
    icon: icons.Cash,
    value: CONST.IOU.PAYMENT_TYPE.ELSEWHERE,
    shouldUpdateSelectedIndex: true,
    onSelected: () => {
    if (checkForNecessaryAction()) {
    return;
    }
    onPress(CONST.IOU.PAYMENT_TYPE.ELSEWHERE, payAsBusiness, undefined);
    },
    },
    ];
    };
    if (isIndividualInvoiceRoomUtil(chatReport)) {
    buttonOptions.push({
    text: translate('iou.settlePersonal', {formattedAmount}),
    icon: icons.User,
    value: hasIntentToPay ? CONST.IOU.PAYMENT_TYPE.EXPENSIFY : (lastPaymentMethod ?? CONST.IOU.PAYMENT_TYPE.ELSEWHERE),
    backButtonText: translate('iou.individual'),
    subMenuItems: getInvoicesOptions(false),
    });
    buttonOptions.push({
    text: translate('iou.settleBusiness', {formattedAmount}),
    icon: icons.Building,
    value: hasIntentToPay ? CONST.IOU.PAYMENT_TYPE.EXPENSIFY : (lastPaymentMethod ?? CONST.IOU.PAYMENT_TYPE.ELSEWHERE),
    backButtonText: translate('iou.business'),
    subMenuItems: getInvoicesOptions(true),
    });
    } else {
    // If there is pay as business option, we should show the submenu items instead.
    buttonOptions.push(...getInvoicesOptions(true));
    }
    }
    if (shouldShowApproveButton) {
    buttonOptions.push(approveButtonOption);
    }
    return buttonOptions;
    // We don't want to reorder the options when the preferred payment method changes while the button is still visible except for component initialization when the last payment method is not initialized yet.
    // We need to be sure that onPress should be wrapped in an useCallback to prevent unnecessary updates.
    // eslint-disable-next-line react-hooks/exhaustive-deps
    }, [
    paymentMethods,
    isLoadingLastPaymentMethod,
    iouReport,
    translate,
    formattedAmount,
    shouldDisableApproveButton,
    isInvoiceReport,
    currency,
    shouldHidePaymentOptions,
    shouldShowApproveButton,
    shouldShowPayWithExpensifyOption,
    shouldShowPayElsewhereOption,
    chatReport,
    onPress,
    onlyShowPayElsewhere,
    latestBankItem,
    activeAdminPolicies,
    checkForNecessaryAction,
    icons,
    ]);

    Condition Options Shown
    canUseWallet (IOU only, currency supported) Wallet option
    canUseBusinessBankAccount (expense/IOU) Business bank options
    canUsePersonalBankAccount Personal bank options
    shouldShowApproveButton && shouldHidePaymentOptions Approve only
    onlyShowPayElsewhere Pay elsewhere only
    isInvoiceReport Invoice-specific options

    What changes do you think we should make in order to solve the problem?

    1. Add UI Tests with @testing-library/react-native (Primary)

    Create tests/ui/components/SettlementButtonTest.tsx following the existing pattern in IOURequestStepConfirmationPageTest.tsx:

    https://github.com/Expensify/App/blob/4947e55428f663a0d7e00bbfced3da4e985e2989/tests/ui/components/IOURequestStepConfirmationPageTest.tsx

    Test setup with Onyx mocking:

    import {render, screen} from '@testing-library/react-native';
    import Onyx from 'react-native-onyx';
    import SettlementButton from '@components/SettlementButton';
    import ONYXKEYS from '@src/ONYXKEYS';
    import CONST from '@src/CONST';
    import {translateLocal} from '../../utils/TestHelper';
    import waitForBatchedUpdatesWithAct from '../../utils/waitForBatchedUpdatesWithAct';
    
    // Mock Navigation
    jest.mock('@libs/Navigation/Navigation', () => ({
        navigate: jest.fn(),
        goBack: jest.fn(),
    }));
    
    // Wrapper with required providers
    function SettlementButtonWrapper({children}: {children: React.ReactNode}) {
        return (
            <LocaleContextProvider>
                {children}
            </LocaleContextProvider>
        );
    }
    
    describe('SettlementButton', () => {
        beforeEach(() => {
            Onyx.init({keys: ONYXKEYS});
        });
    
        afterEach(() => {
            Onyx.clear();
            jest.clearAllMocks();
        });
    });

    Test cases for button text (customText):

    describe('customText', () => {
        it('displays "Pay" when shouldUseShortForm is true', async () => {
            render(
                <SettlementButtonWrapper>
                    <SettlementButton
                        shouldUseShortForm
                        onPress={jest.fn()}
                        // ... required props
                    />
                </SettlementButtonWrapper>
            );
            await waitForBatchedUpdatesWithAct();
            expect(screen.getByText(translateLocal('iou.pay'))).toBeTruthy();
        });
    
        it('displays "Pay elsewhere" for ELSEWHERE payment method', async () => {
            await act(async () => {
                await Onyx.merge(ONYXKEYS.NVP_LAST_PAYMENT_METHOD, {
                    [policyID]: {[reportType]: CONST.IOU.PAYMENT_TYPE.ELSEWHERE}
                });
            });
            render(<SettlementButtonWrapper><SettlementButton {...props} /></SettlementButtonWrapper>);
            await waitForBatchedUpdatesWithAct();
            expect(screen.getByText(translateLocal('iou.payElsewhere', {formattedAmount: '$100'}))).toBeTruthy();
        });
    });

    Test cases for subtitle (secondLineText) by report type:

    describe('secondLineText', () => {
        describe('Expense Reports', () => {
            it('shows bank account for expense report with policy achAccount', async () => {
                await act(async () => {
                    await Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${POLICY_ID}`, {
                        achAccount: {accountNumber: '1234', bankAccountID: 1}
                    });
                    await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, {
                        type: CONST.REPORT.TYPE.EXPENSE, policyID: POLICY_ID
                    });
                });
                render(<SettlementButtonWrapper><SettlementButton {...expenseReportProps} /></SettlementButtonWrapper>);
                await waitForBatchedUpdatesWithAct();
                expect(screen.getByText(/1234/)).toBeTruthy(); // Bank account last 4
            });
        });
    
        describe('Invoice Reports', () => {
            it('shows business bank label for invoice with business account', async () => {
                await act(async () => {
                    await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, {
                        type: CONST.REPORT.TYPE.INVOICE
                    });
                    // Set up business bank account
                });
                render(<SettlementButtonWrapper><SettlementButton {...invoiceProps} /></SettlementButtonWrapper>);
                await waitForBatchedUpdatesWithAct();
                expect(screen.getByText(translateLocal('iou.invoiceBusinessBank', '5678'))).toBeTruthy();
            });
        });
    
        describe('IOU Reports', () => {
            it('shows Wallet for IOU with EXPENSIFY payment method', async () => {
                await act(async () => {
                    await Onyx.merge(ONYXKEYS.NVP_LAST_PAYMENT_METHOD, {
                        [CONST.POLICY.ID_FAKE]: {iou: CONST.IOU.PAYMENT_TYPE.EXPENSIFY}
                    });
                    await Onyx.merge(ONYXKEYS.PERSONAL_BANK_ACCOUNT_LIST, [{bankAccountID: 1}]);
                });
                render(<SettlementButtonWrapper><SettlementButton {...iouProps} /></SettlementButtonWrapper>);
                await waitForBatchedUpdatesWithAct();
                expect(screen.getByText(translateLocal('common.wallet'))).toBeTruthy();
            });
        });
    });

    Test cases for payment options dropdown:

    describe('paymentButtonOptions', () => {
        it('shows wallet option for IOU with supported currency', async () => {
            await act(async () => {
                await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, {
                    type: CONST.REPORT.TYPE.IOU, currency: 'USD'
                });
            });
            render(<SettlementButtonWrapper><SettlementButton {...iouProps} /></SettlementButtonWrapper>);
            await waitForBatchedUpdatesWithAct();
            // Open dropdown and verify wallet option exists
            fireEvent.press(screen.getByTestId('settlement-button-dropdown'));
            expect(screen.getByText(translateLocal('iou.settleWallet', {formattedAmount: ''}))).toBeTruthy();
        });
    
        it('does NOT show wallet option for expense reports', async () => {
            await act(async () => {
                await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, {
                    type: CONST.REPORT.TYPE.EXPENSE
                });
            });
            render(<SettlementButtonWrapper><SettlementButton {...expenseProps} /></SettlementButtonWrapper>);
            await waitForBatchedUpdatesWithAct();
            fireEvent.press(screen.getByTestId('settlement-button-dropdown'));
            expect(screen.queryByText(translateLocal('iou.settleWallet', {formattedAmount: ''}))).toBeNull();
        });
    
        it('shows only Approve button when shouldHidePaymentOptions and shouldShowApproveButton', async () => {
            render(
                <SettlementButtonWrapper>
                    <SettlementButton
                        shouldHidePaymentOptions
                        shouldShowApproveButton
                        {...props}
                    />
                </SettlementButtonWrapper>
            );
            await waitForBatchedUpdatesWithAct();
            expect(screen.getByText(translateLocal('iou.approve', {formattedAmount: '$100'}))).toBeTruthy();
        });
    });

    2. Remove Manual Memoization (25 instances)

    Strategy for each memoization type:

    Hook Count Action
    Simple derived values (lastPaymentMethod) ~5 Remove useMemo, use direct expression
    Callbacks passed to children (checkForNecessaryAction) ~8 Keep useCallback, React Compiler will optimize
    Complex computations (paymentButtonOptions) ~12 Keep useMemo with simplified deps

    Example - simple derived value:

    // Remove useMemo for simple derivations
    const lastPaymentMethod = iouReport?.type
        ? getLastPolicyPaymentMethod(policyIDKey, personalPolicyID, lastPaymentMethods, iouReport.type, isIOUReport(iouReport))
        : undefined;

    Example - complex computation with stable deps:

    // Keep useMemo but extract stable primitive deps
    const paymentButtonOptions = useMemo(
        () => buildPaymentOptions({isExpenseReport, isInvoiceReport, currency, ...}),
        [isExpenseReport, isInvoiceReport, currency, ...]
    );

    3. Optional: Extract Helper for Complex Logic

    If the UI tests reveal that getSecondaryText logic is particularly hard to test through the UI, we can optionally extract it to SettlementButtonUtils.ts for supplementary unit tests:

    https://github.com/Expensify/App/blob/4947e55428f663a0d7e00bbfced3da4e985e2989/src/libs/SettlementButtonUtils.ts

    This would be in addition to (not instead of) the UI tests.

  11. roryabraham commented on Jan 12, 2026

    @roryabraham
    ContributorAuthor

    @TaduJR extracting pure functions and using "normal" unit functions could work, but could we instead use UI tests with @testing-library/react-native (see examples in tests/ui) to write UI tests that directly cover SettlementButton? I think that might be better in that it directly covers the component, handling potential oddities surrounding React lifecycle, incorrect memoization, etc...

  12. 78 remaining items

  13. melvin-bot commented on May 25, 2026

    @melvin-bot

    This issue has not been updated in over 15 days. @mallenexpensify, @roryabraham, @linhvovan29546, @TaduJR eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  14. melvin-bot commented on Jul 22, 2026

    @melvin-bot

    @mallenexpensify, @roryabraham, @linhvovan29546, @TaduJR, this Monthly task hasn't been acted upon in 6 weeks; closing.

    If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.

  15. linhvovan29546 commented on Jul 28, 2026

    @linhvovan29546
    Contributor

    @roryabraham Could you please reopen the issue? Tks

  16. melvin-bot commented on Oct 2, 2026

    @melvin-bot

    @mallenexpensify, @roryabraham, @linhvovan29546, @TaduJR, this Monthly task hasn't been acted upon in 6 weeks; closing.

    If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.

  17. reopened this on Oct 3, 2026
  18. expensify-chore-bot commented on Nov 30, 2026

    @expensify-chore-bot

    @mallenexpensify, @roryabraham, @linhvovan29546, @TaduJR, this Monthly task hasn't been acted upon in 6 weeks; closing.

    If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugExternalMonthlyNot a priorityReviewing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions