Skip to content

Swaps 4038 trending e2e#27116

Closed
bfullam wants to merge 34 commits into
mainfrom
swaps-4038-trending-e2e
Closed

Swaps 4038 trending e2e#27116
bfullam wants to merge 34 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

Medium Risk
Moderate UI-behavior change in BridgeView that alters what content renders across loading/error/zero/quote states and adds scroll-driven pagination for trending tokens; could affect bridge screen layout and user flows but does not touch auth or transaction signing logic.

Overview
Refactors BridgeView to render the token input areas inside the main ScrollView and introduces an explicit content-mode switch (loading, error, quote, zero) to control what appears in the dynamic section.

In loading (no active quote), the view now shows a QuoteDetailsCardSkeleton (and hides the prior “Fetching quote” text); in zero state, it conditionally renders BridgeTrendingTokensSection behind the temporary swapsTrendingTokens remote feature flag, with near-bottom scroll detection to auto-load additional token rows.

Tests were updated to match the new modes and selectors: snapshot assertions were removed, new BridgeViewSelectorsIDs were added for trending filters/show-more and the quote skeleton, and BridgeView/view tests now validate loading/error/quote/zero rendering and explicitly trigger keypad open/close via input interactions.

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

bfullam added 4 commits March 3, 2026 15:57
…okens

# Conflicts:
#	app/components/UI/Bridge/Views/BridgeView/__snapshots__/BridgeView.test.tsx.snap
#	app/components/UI/Bridge/Views/BridgeView/index.tsx
@bfullam bfullam requested review from a team as code owners March 6, 2026 09:12
@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
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.

expect(getByTestId(BridgeViewSelectorsIDs.SOURCE_TOKEN_AREA)).toBeTruthy();
expect(
getByTestId(BridgeViewSelectorsIDs.DESTINATION_TOKEN_AREA),
).toBeTruthy();
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.

New test assertions use toBeTruthy() instead of toBeOnTheScreen()

Low Severity

Multiple newly added test assertions use toBeTruthy() to verify element presence (e.g., expect(getByTestId(...)).toBeTruthy()) instead of toBeOnTheScreen(). This violates the unit testing guidelines rule: "ALWAYS use toBeOnTheScreen() to assert element presence — NOT toBeTruthy() or toBeDefined()." Affected new assertions appear at lines 363, 366, 848, 887, 890, 924, 962, 964, and 1019.

Additional Locations (2)

Fix in Cursor Fix in Web

Triggered by project rule: Unit Testing Guidelines

@bfullam bfullam closed this Mar 6, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size-M team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants