Skip to content

test: convert ramps e2e to cv#30417

Merged
cortisiko merged 18 commits into
mainfrom
MMQA-1763
May 21, 2026
Merged

test: convert ramps e2e to cv#30417
cortisiko merged 18 commits into
mainfrom
MMQA-1763

Conversation

@cortisiko

@cortisiko cortisiko commented May 20, 2026

Copy link
Copy Markdown
Member

Description

Adds new component-view test coverage for Ramps flows, including Aggregator (V1) BuildQuote/Quotes and V2 unified-buy BuildQuote, validating deeplink params, token/payment selection, account switching, settings→order-history navigation, and quote fetching.

Introduces Ramp-specific component-view infrastructure: nock-based Ramp SDK API mocking (tests/component-view/api-mocking/ramp.ts), new ramps state presets/fixtures (tests/component-view/presets/ramps.ts), and reusable renderers that mount Ramp screens with modal routes + react-query (tests/component-view/renderers/ramps.tsx). Updates shared test scaffolding to support these flows (nock localhost allowlist behavior, Engine mocks for RampsController.getQuotes and account-tree selection).

Removes several legacy e2e/spec files that previously covered these ramps scenarios.

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

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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: changes are primarily test infrastructure and new component-view coverage; production code changes are limited to swapping hardcoded testIDs to shared constants.

Overview
Adds new component-view test suites for Ramp Aggregator BuildQuote/Quotes and V2 unified-buy BuildQuote, covering deeplink initialization, token/payment selection, account switching, settings→order-history navigation, and quote-fetching behavior.

Introduces Ramp-focused component-view infrastructure: nock-based Ramp SDK HTTP mocking (tests/component-view/api-mocking/ramp.ts), reusable render helpers that mount Ramp screens with modal routes + react-query (tests/component-view/renderers/ramps.tsx), and state presets/fixtures for common ramp scenarios (tests/component-view/presets/ramps.ts).

Cleans up legacy Detox/e2e ramps specs (including previously failing/skipped suites) and tweaks shared test scaffolding (disableNetConnect localhost allowlist, additional Engine controller mocks). Also standardizes a couple of UI testIDs via constants (NavbarSelectorsIDs.DEPOSIT_CONFIGURATION_BUTTON, BUILD_QUOTE_TEST_IDS.PAYMENT_PILL).

Reviewed by Cursor Bugbot for commit 59bdbe2. Bugbot is set up for automated code reviews on this repo. Configure here.

@metamaskbotv2 metamaskbotv2 Bot added the team-qa QA team label May 20, 2026
@cortisiko cortisiko marked this pull request as ready for review May 20, 2026 16:09
@cortisiko cortisiko requested review from a team as code owners May 20, 2026 16:09
Comment thread tests/component-view/api-mocking/nockHelpers.ts Outdated
@github-actions github-actions Bot added size-XL and removed size-L labels May 20, 2026
@cortisiko cortisiko added no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed no changelog required No changelog entry is required for this change labels May 20, 2026
Comment thread app/components/UI/Ramp/Views/BuildQuote/BuildQuote.view.test.tsx Outdated
Comment thread app/components/UI/Ramp/Views/BuildQuote/BuildQuote.view.test.tsx Outdated
Comment thread tests/component-view/renderers/ramps.tsx
Comment thread app/components/UI/Ramp/Views/BuildQuote/BuildQuote.view.test.tsx Outdated
Comment thread app/components/UI/Ramp/Views/BuildQuote/BuildQuote.view.test.tsx Outdated
amitabh94
amitabh94 previously approved these changes May 20, 2026

@amitabh94 amitabh94 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor comment but otherwise LGTM

chrisleewilcox
chrisleewilcox previously approved these changes May 20, 2026
@cortisiko cortisiko added this pull request to the merge queue May 21, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 21, 2026
@cortisiko cortisiko dismissed stale reviews from chrisleewilcox and amitabh94 via 3b2b291 May 21, 2026 03:20
Comment thread tests/component-view/renderers/ramps.tsx Outdated
Comment thread tests/component-view/presets/ramps.ts Outdated
Comment thread app/components/UI/Ramp/Aggregator/Views/BuildQuote/BuildQuote.view.test.tsx Outdated
Comment thread tests/component-view/renderers/ramps.tsx
Comment thread tests/component-view/renderers/ramps.tsx Outdated
Comment thread app/components/UI/Ramp/Aggregator/Views/Quotes/Quotes.view.test.tsx Outdated
Comment thread tests/component-view/renderers/ramps.tsx

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

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 1 potential issue.

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.

Reviewed by Cursor Bugbot for commit 59bdbe2. Configure here.

Comment thread tests/component-view/renderers/ramps.tsx
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The changes in this PR are primarily:

  1. Cosmetic refactors in app code: Two hardcoded test ID strings replaced with constants ("build-quote-payment-pill"BUILD_QUOTE_TEST_IDS.PAYMENT_PILL and 'deposit-configuration-menu-button'NavbarSelectorsIDs.DEPOSIT_CONFIGURATION_BUTTON). The actual string values remain identical, so no E2E tests that reference these IDs will break.

  2. Deleted E2E tests: Five test files removed — all were either already skipped (describe.skip) or marked as .failing.ts, meaning they weren't running in CI anyway. Their removal has no impact on test coverage.

  3. New component-view (unit) tests: New test infrastructure (tests/component-view/api-mocking/ramp.ts, presets/ramps.ts, renderers/ramps.tsx) and new .view.test.tsx files for BuildQuote (both V1 Aggregator and V2) and Quotes screens. These are Jest unit tests, not Detox E2E tests.

  4. Test infrastructure improvements: Fixed nock v14 compatibility in nockHelpers.ts, added more mock stubs to mocks.ts for RampsController and GasFeeController.

Risk assessment: Low risk. No functional app logic changed. The ramps/buy/sell flow is the only area touched, warranting SmokeMoney to validate the ramps UI still works correctly with the refactored test IDs. No other flows are affected — Navbar change is isolated to the deposit configuration button in the ramps context, and the deleted tests were non-functional anyway.

Performance Test Selection:
No performance-sensitive changes. The app code changes are purely cosmetic refactors (string constants), and all other changes are test infrastructure (component-view mocks, presets, renderers). No UI rendering, data loading, state management, or critical user flow performance is affected.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.24%. Comparing base (de8a354) to head (59bdbe2).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #30417      +/-   ##
==========================================
+ Coverage   82.14%   82.24%   +0.10%     
==========================================
  Files        5490     5494       +4     
  Lines      147805   148107     +302     
  Branches    33992    34074      +82     
==========================================
+ Hits       121412   121813     +401     
+ Misses      18084    18002      -82     
+ Partials     8309     8292      -17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cortisiko cortisiko enabled auto-merge May 21, 2026 16:09
@cortisiko cortisiko added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit 4416837 May 21, 2026
187 of 190 checks passed
@cortisiko cortisiko deleted the MMQA-1763 branch May 21, 2026 16:35
@github-actions github-actions Bot locked and limited conversation to collaborators May 21, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.79.0 Issue or pull request that will be included in release 7.79.0 label May 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no changelog required No changelog entry is required for this change no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.79.0 Issue or pull request that will be included in release 7.79.0 size-XL team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants