Conversation
| hasValidFiatAmount && | ||
| !isQuotesLoading && | ||
| sourceAmounts?.length === 0 && | ||
| quotes?.length === 0; |
There was a problem hiding this comment.
Fiat no-quotes alert never triggers with undefined arrays
Medium Severity
sourceAmounts?.length === 0 and quotes?.length === 0 evaluate to false when either value is undefined, because undefined === 0 is false. The selectors selectTransactionPayQuotesByTransactionId and selectTransactionPaySourceAmountsByTransactionId return transactionData?.quotes and transactionData?.sourceAmounts directly, which are undefined when no data exists — not empty arrays. The non-fiat path correctly uses !quotes?.length (truthy for both undefined and []), but the fiat path's strict equality means shouldShowFiatNoQuotesAlert will never be true when the controller hasn't populated these fields, silently suppressing the "no quotes" alert for fiat users.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| expect(queryByText('10%')).toBeNull(); | ||
| expect(queryByText('25%')).toBeNull(); | ||
| expect(queryByText('50%')).toBeNull(); | ||
| expect(queryByText('90%')).toBeNull(); |
There was a problem hiding this comment.
Tests use toBeNull instead of not.toBeOnTheScreen
Low Severity
The new tests assert element absence using toBeNull() but the Unit Testing Guidelines require not.toBeOnTheScreen() for these checks. Specifically, deposit-keyboard.test.tsx has four expect(queryByText(...)).toBeNull() calls, and bridge-time-row.test.tsx has one. All should use expect(...).not.toBeOnTheScreen() instead.
Additional Locations (1)
Triggered by project rule: Unit Testing Guidelines
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag selection rationale:
Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|





Description
updateFiatPaymentinstead ofupdateTokenAmountwhen fiat is selected, and percentage quick-pick buttons are hiddenhidePercentageButtonsprop toDepositKeyboardfor fiat modeChangelog
CHANGELOG entry:
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/7069
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes confirmation amount submission and alert/row visibility logic when a fiat payment method is selected, which can affect when transactions are considered valid/blocking. Risk is moderate due to user-facing confirmation flow changes and new branching based on fiat state.
Overview
Fiat payment mode is now handled as a distinct path in confirmations. When a fiat payment method is selected, the amount "Done" action updates fiat payment state via
TransactionPayController.updateFiatPaymentinstead of committing a token amount.UI and alerts adapt to fiat selection.
DepositKeyboardgainshidePercentageButtons(and tests) to hide percentage quick-picks in fiat mode,BridgeTimeRowno longer renders when a fiat method is selected,useInsufficientPayTokenBalanceAlertreturns no alerts under fiat selection, anduseNoPayTokenQuotesAlertnow also triggers a blocking "no quotes" alert for fiat when a valid fiat amount is entered but quotes/source amounts are empty (with added test coverage).Written by Cursor Bugbot for commit caa29fe. This will update automatically on new commits. Configure here.