Skip to content

test: removes non used dead code#30179

Merged
christopherferreira9 merged 2 commits into
mainfrom
cferreira/remove-dead-code
May 14, 2026
Merged

test: removes non used dead code#30179
christopherferreira9 merged 2 commits into
mainfrom
cferreira/remove-dead-code

Conversation

@christopherferreira9

@christopherferreira9 christopherferreira9 commented May 14, 2026

Copy link
Copy Markdown
Contributor

Description

#29587 added code that is test specific oriented and isn't being used. This PR removes this code in order to cleanup FixtureHelper.

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

N/A

Screenshots/Recordings

Before

N/A

After

N/A

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 test-only cleanup: removes an unused option and associated mock wiring, which could only affect E2E tests that implicitly relied on the default swap popular-tokens mock.

Overview
Removes the unused shouldPrefetchSwapTokens option from WithFixturesOptions and eliminates the corresponding FixtureHelper.withFixtures cleanup-time hook that auto-mocked the swap popular-tokens endpoint.

E2E tests must now explicitly set up swap token mocks (e.g., via swap-specific test mocks) rather than relying on withFixtures to preconfigure them.

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

@christopherferreira9 christopherferreira9 requested a review from a team as a code owner May 14, 2026 11:38
@christopherferreira9 christopherferreira9 added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label May 14, 2026
@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.

@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 3dcbe72. Configure here.

Comment thread tests/framework/fixtures/FixtureHelper.ts
davibroc
davibroc previously approved these changes May 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The changes remove the automatic mockSwapPopularTokens call from the global withFixtures fixture helper, along with the shouldPrefetchSwapTokens option from WithFixturesOptions.

Key findings:

  1. shouldPrefetchSwapTokens defaulted to true, meaning ALL tests using withFixtures previously had swap popular tokens automatically mocked.
  2. No test was found using shouldPrefetchSwapTokens: false (confirmed by grep), so no test was explicitly opting out.
  3. The swap test files that need this mock (unified-ui-wallet-actions.spec.ts, swap-trending-tokens.spec.ts) already call mockSwapPopularTokens directly in their own test-specific mock setup.
  4. The change is a cleanup removing a global mock that was applied to all tests but only needed by specific swap tests.

The primary risk is that some swap-related tests may have been implicitly relying on the global mock without setting it up themselves. SmokeSwap tests must be run to validate they still work correctly after this change. SmokeConfirmations is included because swap flows involve transaction confirmations per the tag descriptions.

Performance Test Selection:
These changes are purely to the E2E test framework infrastructure (fixture helper and types). They remove a global mock setup for swap popular tokens. There is no impact on app production code, UI rendering, data loading, or any runtime performance characteristics. No performance tests are needed.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@christopherferreira9 christopherferreira9 added this pull request to the merge queue May 14, 2026
Merged via the queue into main with commit 975cead May 14, 2026
100 checks passed
@christopherferreira9 christopherferreira9 deleted the cferreira/remove-dead-code branch May 14, 2026 14:44
@github-actions github-actions Bot locked and limited conversation to collaborators May 14, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.78.0 Issue or pull request that will be included in release 7.78.0 label May 14, 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.78.0 Issue or pull request that will be included in release 7.78.0 size-XS team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants