Skip to content

test: add component view tests for EVM and ERC-1155 send flows#27759

Merged
davibroc merged 4 commits into
mainfrom
test/add-more-send-cvt
Mar 24, 2026
Merged

test: add component view tests for EVM and ERC-1155 send flows#27759
davibroc merged 4 commits into
mainfrom
test/add-more-send-cvt

Conversation

@davibroc
Copy link
Copy Markdown
Contributor

@davibroc davibroc commented Mar 20, 2026

Adds 5 new view tests covering previously untested send scenarios:

  • EVM ETH happy path (Amount → Recipient → Review button enabled)
  • Invalid address disables Review with error text
  • Token contract address opens SendAlertModal; cancel closes it
  • Amount exceeding balance shows Insufficient funds on Continue
  • ERC-1155 Amount screen shows NFT name and Next button lifecycle

Description

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
Low risk since changes are limited to component-view tests and test mocks, with no production logic modifications.

Overview
Adds new component-view coverage for EVM send flows, including ETH happy path navigation, invalid recipient validation, insufficient-funds gating, and the token-contract recipient warning modal (with modal CANCEL_BUTTON/ACKNOWLEDGE_BUTTON test IDs).

Extends the component-view Engine mock to include AssetsContractController.getTokenStandardAndDetails, enabling tests to simulate token contract address detection and reset mock behavior between cases.

Written by Cursor Bugbot for commit b4acf8f. This will update automatically on new commits. Configure here.

Adds 5 new view tests covering previously untested send scenarios:
- EVM ETH happy path (Amount → Recipient → Review button enabled)
- Invalid address disables Review with error text
- Token contract address opens SendAlertModal; cancel closes it
- Amount exceeding balance shows Insufficient funds on Continue
- ERC-1155 Amount screen shows NFT name and Next button lifecycle

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@davibroc davibroc requested a review from a team as a code owner March 20, 2026 18:56
@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-qa QA team label Mar 20, 2026
@github-actions github-actions Bot added size-M risk-low Low testing needed · Low bug introduction risk labels Mar 20, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread app/components/Views/confirmations/components/send/send.view.test.tsx Outdated
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 20, 2026
@davibroc davibroc added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Mar 20, 2026
- Add EVM happy path (Amount → Recipient, valid address enables Review)
- Add invalid address disables Review with error text
- Add token contract address triggers alert modal; cancel closes it
- Add insufficient balance disables Continue (shows error label)
- Add ERC-1155 Amount screen shows NFT name, Next button enabled on input
- Create send-alert-modal.testIds.ts with selector ID constants
- Add AssetsContractController stub to component-view Engine mock

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 20, 2026
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 97%
click to see 🤖 AI reasoning details

E2E Test Selection:
All three changed files are purely test/unit test infrastructure changes with zero production app code modifications:

  1. tests/component-view/mocks.ts (CRITICAL path): Adds AssetsContractController.getTokenStandardAndDetails mock to the Engine mock used by component-view unit tests. This is a test infrastructure addition that enables new unit tests to run without errors. No production code is affected.

  2. app/components/Views/confirmations/components/send/send-alert-modal/send-alert-modal.testIds.ts (new file): Defines test ID constants (CANCEL_BUTTON, ACKNOWLEDGE_BUTTON) for the send alert modal. This file is only imported in the unit test file (send.view.test.tsx) and not referenced in any E2E tests.

  3. app/components/Views/confirmations/components/send/send.view.test.tsx: Adds new unit tests for EVM send flows (ETH happy path, invalid address validation, token contract address alert modal, insufficient funds, ERC-1155 NFT send). These are Jest/component-view unit tests, not Detox E2E tests.

No production app code was changed. No E2E test files were modified. The send-alert-modal.testIds.ts file is not referenced by any E2E test. The mock change in mocks.ts only affects component-view unit tests. There is no risk to any E2E test flows, and no performance-sensitive code was touched.

Performance Test Selection:
No production app code was changed. All modifications are limited to unit test files and test infrastructure (mocks, test IDs). There is no impact on UI rendering, state management, data loading, or any performance-sensitive code paths.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@racitores racitores left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@davibroc davibroc added this pull request to the merge queue Mar 24, 2026
Merged via the queue into main with commit 9874d9c Mar 24, 2026
63 checks passed
@davibroc davibroc deleted the test/add-more-send-cvt branch March 24, 2026 22:13
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 24, 2026
@metamaskbot metamaskbot added the release-7.72.0 Issue or pull request that will be included in release 7.72.0 label Mar 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.72.0 Issue or pull request that will be included in release 7.72.0 risk-low Low testing needed · Low bug introduction risk size-M team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants