Skip to content

test: add swaps trending e2e tests#27118

Merged
bfullam merged 6 commits into
mainfrom
swaps-4038-trending-e2e
Mar 6, 2026
Merged

test: add swaps trending e2e tests#27118
bfullam merged 6 commits into
mainfrom
swaps-4038-trending-e2e

Conversation

@bfullam
Copy link
Copy Markdown
Contributor

@bfullam bfullam commented Mar 6, 2026

Description

Adds minimal SmokeTrade E2E coverage for Bridge Swap Trending Tokens zero-state behavior as a follow-up to the feature PR to keep implementation and test review separated.

Scope is intentionally narrow:

  • Verifies zero-state trending section visibility and filter interaction flow.
  • Verifies row navigation behavior from trending list.
  • Uses existing smoke framework/page-object patterns.

Changelog

CHANGELOG entry: null

Related issues

Fixes: Follow-up coverage for #26620 (SWAPS-4038)

Manual testing steps

Feature: Swap trending tokens smoke coverage

  Scenario: user validates bridge zero-state trending interactions
    Given the app is running with swap trending tokens enabled
    And the user is on the Swap screen in Bridge zero state

    When the user opens and applies trending filters
    Then the trending list reflects the selected filters

    When the user taps a trending token row
    Then the user is navigated to that token's asset details

Screenshots/Recordings

Before

N/A (test-only follow-up PR)

After

N/A (test-only follow-up PR)

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
Primarily adds/adjusts test code and refactors testID constants; production behavior is unchanged aside from testID wiring, so risk is low and limited to potential selector breakage in tests.

Overview
Adds a new SmokeTrade Detox spec validating Bridge zero-state trending tokens behavior end-to-end: feature-flagged enablement, filter bottom sheets (price/time/network), token-row navigation to asset details, and trending section hiding once a quote amount is entered.

Refactors trending token testIDs out of BridgeViewSelectorsIDs into a dedicated BridgeTrendingTokensSectionTestIds module, updates BridgeTrendingTokensSection and related unit tests/mocks accordingly, and introduces a SwapTrendingTokensView page object to drive the new E2E flow.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 6, 2026

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-swaps-and-bridge Swaps and Bridge team label Mar 6, 2026
@github-actions github-actions Bot added the size-M label Mar 6, 2026
Comment thread app/components/UI/Bridge/Views/BridgeView/BridgeView.test.tsx
@bfullam bfullam force-pushed the swaps-4038-trending-e2e branch from 7e90d12 to bec34dc Compare March 6, 2026 09:19
@bfullam bfullam requested a review from a team as a code owner March 6, 2026 09:19
Comment thread tests/page-objects/swaps/SwapTrendingTokensView.ts
Comment thread tests/page-objects/swaps/SwapTrendingTokensView.ts Outdated
Comment thread tests/smoke/swap/swap-trending-tokens.spec.ts
Comment thread tests/page-objects/swaps/SwapTrendingTokensView.ts
@bfullam bfullam requested a review from a team as a code owner March 6, 2026 11:41
Copy link
Copy Markdown
Contributor

@christopherferreira9 christopherferreira9 left a comment

Choose a reason for hiding this comment

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

LGTM

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

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/UI/Bridge/Views/BridgeView/BridgeView.test.tsx
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 6, 2026

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeTrade, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
This PR introduces a new E2E test for swap trending tokens functionality and refactors test IDs for the BridgeTrendingTokensSection component.

Key changes:

  1. New E2E test: tests/smoke/swap/swap-trending-tokens.spec.ts - explicitly tagged with SmokeTrade, tests the trending tokens feature in the swap/bridge zero-state view
  2. New page object: tests/page-objects/swaps/SwapTrendingTokensView.ts - provides test utilities for interacting with trending tokens UI
  3. Test ID refactoring: Moved trending-related test IDs from BridgeView.testIds.ts to a new dedicated file BridgeTrendingTokensSectionTestIds.ts
  4. Unit test updates: Updated BridgeView.test.tsx and BridgeTrendingTokensSection.test.tsx to use the new test ID imports

The component logic in BridgeTrendingTokensSection.tsx is unchanged - only the import path for test IDs was modified.

Selected tags:

  • SmokeTrade: The new test is explicitly tagged with SmokeTrade and tests swap/bridge trending tokens functionality. This is the primary tag needed to validate the new E2E test works correctly.
  • SmokeConfirmations: Per the tag guidance, when selecting SmokeTrade for swap/bridge flows, SmokeConfirmations should also be selected as transaction confirmations are part of the flow.

This is medium risk because it adds new E2E test infrastructure that needs validation, but the actual app functionality remains unchanged.

Performance Test Selection:
No performance tests are needed for this PR. The changes are focused on E2E test infrastructure (new test file, page object, test ID refactoring) with no functional changes to the app code that would impact performance. The BridgeTrendingTokensSection component logic is unchanged - only test ID imports were modified. There are no changes to UI rendering, data loading, state management, or critical user flows that would warrant performance testing.

View GitHub Actions results

@bfullam bfullam enabled auto-merge March 6, 2026 12:07
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 6, 2026

⚠️ E2E Fixture Validation — Structural changes detected

Category Count
New keys 68
Missing keys 11
Type mismatches 0
Value mismatches 7 (informational)

The committed fixture schema is out of date. To update, comment:

@metamaskbot update-mobile-fixture

View full details | Download diff report

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.54%. Comparing base (43e62f8) to head (ffebb00).
⚠️ Report is 34 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #27118      +/-   ##
==========================================
+ Coverage   81.52%   81.54%   +0.01%     
==========================================
  Files        4626     4638      +12     
  Lines      121238   121448     +210     
  Branches    26642    26690      +48     
==========================================
+ Hits        98845    99032     +187     
- Misses      15446    15461      +15     
- Partials     6947     6955       +8     

☔ 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.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

@christopherferreira9 christopherferreira9 left a comment

Choose a reason for hiding this comment

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

LGTM

@bfullam bfullam added this pull request to the merge queue Mar 6, 2026
Merged via the queue into main with commit bbf465f Mar 6, 2026
96 checks passed
@bfullam bfullam deleted the swaps-4038-trending-e2e branch March 6, 2026 15:47
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 6, 2026
@metamaskbot metamaskbot added the release-7.70.0 Issue or pull request that will be included in release 7.70.0 label Mar 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.70.0 Issue or pull request that will be included in release 7.70.0 size-M team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants