Skip to content

test: add component view tests and skip duplicated smoke E2E#28911

Merged
racitores merged 11 commits into
mainfrom
qa/e2e-cleanup
May 7, 2026
Merged

test: add component view tests and skip duplicated smoke E2E#28911
racitores merged 11 commits into
mainfrom
qa/e2e-cleanup

Conversation

@racitores
Copy link
Copy Markdown
Contributor

@racitores racitores commented Apr 16, 2026

Description

This PR adds component view tests (CVT) for flows that were previously covered by smoke E2E only, and skips those E2E cases (eventually delete them). Smoke specs keep the original test bodies and point to the CV file with // Moved to cv tests (...).

Example: In network abstraction shard 1 we see a 4m reduction time (android).

E2E → component view test mapping

File Test Name QA Comment CV test file
view-defi-details.spec.ts view DeFi position details just checking some data in the screen app/components/UI/DeFiPositions/DeFiProtocolPositionDetails.view.test.tsx
view-market-insights.spec.ts displays market insights content and navigates to swap app/components/UI/MarketInsights/Views/MarketInsightsView/MarketInsightsView.view.test.tsx
view-market-insights.spec.ts does not display entry card when API returns no data app/components/UI/TokenDetails/components/AssetOverviewContent.view.test.tsx
view-market-insights.spec.ts does not display entry card when feature flag is disabled app/components/UI/TokenDetails/components/AssetOverviewContent.view.test.tsx
view-market-insights.spec.ts navigates to buy screen when tapping Buy button app/components/UI/MarketInsights/Views/MarketInsightsView/MarketInsightsView.view.test.tsx
view-market-insights.spec.ts can tap thumbs up feedback button app/components/UI/MarketInsights/Views/MarketInsightsView/MarketInsightsView.view.test.tsx
send-btc-token.spec.ts shows insufficient funds This only does validation on the input app/components/Views/confirmations/components/send/send.non-evm.view.test.tsx
send-tron-token.spec.ts shows insufficient funds This only does validation on the input app/components/Views/confirmations/components/send/send.non-evm.view.test.tsx
send-erc20-token.spec.ts should send USDC amount 50% to an address CV tests will handle these combinations app/components/Views/confirmations/components/send/send.view.test.tsx
send-erc20-token.spec.ts should send USDC send max to an address CV tests will handle these combinations app/components/Views/confirmations/components/send/send.view.test.tsx
send-native-token.spec.ts should send ETH to an address PARTIALLY: We should only cover ETH send, no need to cover 50% and Max app/components/Views/confirmations/components/send/send.view.test.tsx
send-solana-token.spec.ts should send solana to an address This is not actually sending anything, just checking that the text matches app/components/Views/confirmations/components/send/send.non-evm.view.test.tsx
alert-system.spec.ts should sign typed message Moved to yes as per team review app/components/Views/confirmations/components/alert-banner/alert-system-typed-sign-blockaid.view.test.tsx
alert-system.spec.ts should show security alert for malicious request, acknowledge and confirm the signature Moved to yes as per team review app/components/Views/confirmations/components/alert-banner/alert-system-typed-sign-blockaid.view.test.tsx
alert-system.spec.ts should show security alert for error when validating request fails app/components/Views/confirmations/components/alert-banner/alert-system-security-failed.view.test.tsx
alert-system.spec.ts should show mismatch field alert, click the alert, acknowledge and confirm the signature As long as the component is the same we can do this via CV test app/components/Views/confirmations/components/alert-banner/alert-system-siwe-inline-mismatch.view.test.tsx
gas-fee-tokens-eip-7702-sponsored.spec.ts fails transaction if error occurs on API app/components/Views/confirmations/components/activity/eip-7702-sponsored-relay-api-failure.view.test.tsx
enable-notifications-after-onboarding.spec.ts should enable notifications and view feature announcements and wallet notifications Test is not doing what its title implies; skipped pending owner discussion app/components/Views/Notifications/NotificationsView.view.test.tsx
notification-settings-flow.spec.ts should enable notifications and toggle feature announcements and account notifications UI-only validation, suitable for CV app/components/Views/Settings/NotificationsSettings/NotificationsSettings.view.test.tsx
add-popular-networks.spec.ts adds a popular network directly without confirmation modal This is not in prod anymore No matching *.view.test.tsx on this branch

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: N/A

  Scenario: Automated tests only
    Given developer checks out this branch
    When they run yarn test:view for the touched view test files
    Then tests pass

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 product risk since changes are test-only, but moderate test-suite risk due to new integration-style view tests, new engine/nock mocks, and jest.config.view.js forcing IS_TEST=true for feature-gated code paths.

Overview
Adds component-view (CV) test coverage for several flows previously validated only by smoke E2E: DeFi protocol position details, token Market Insights (including entry card gating + swap/buy navigation + sources sheet + feedback), notifications list/details and notification settings toggles, confirmation alert-system (typed-sign Blockaid benign/malicious + SIWE domain mismatch inline + validation-failed banner), and EIP-7702 sponsored send (failed activity status + “Paid by MetaMask” fee row).

Extends CV test infrastructure with new presets/helpers and mocks (notifications state seeding, Market Insights navigation renderer/preset, SnapController request interceptor, Sentinel /networks nock mock), adds/normalizes several testId constants (send 50% button, confirmation transfer loader, status-icon tooltip), and sets process.env.IS_TEST=true at view-jest config load time to satisfy env-inlined feature gates.

Removes or skips corresponding smoke E2E specs (or individual cases) and updates fixtures/assertions (e.g., SIWE signer address) to align with the new CV coverage.

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

@racitores racitores self-assigned this Apr 16, 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.

@metamaskbot metamaskbot added the team-qa QA team label Apr 16, 2026
@racitores racitores added the skip-e2e-flakiness-detection Skips the E2E flakiness detection (extra runs on new and modified E2E files) label Apr 16, 2026
@racitores racitores marked this pull request as ready for review April 16, 2026 16:46
@racitores racitores requested review from a team as code owners April 16, 2026 16:46
@racitores racitores requested review from a team as code owners April 29, 2026 15:56
Comment thread tests/smoke/notifications/notification-settings-flow.spec.ts
racitores and others added 8 commits May 4, 2026 15:52
- Add CV tests for send, alert system, EIP-7702 relay, DeFi position details, market insights
- Extend Engine mocks (AiDigest, Ramps), market insights renderer and presets
- Annotate smoke specs with CV test filenames; skip E2E where CV replaces coverage
- Silence jest/no-disabled-tests for intentional smoke skips

Made-with: Cursor
Co-authored-by: Cursor <cursoragent@cursor.com>
PatrykLucka
PatrykLucka previously approved these changes May 5, 2026
});
expect(getByText('Signing in with')).toBeDefined();
expect(getByText('0x935E7...05477')).toBeDefined();
expect(getByText('0x8Eeee...73D12')).toBeDefined();
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.

Was this intended?

Copy link
Copy Markdown
Contributor Author

@racitores racitores May 6, 2026

Choose a reason for hiding this comment

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

no, it was an AI decision to make the test consistent with a change done in the fixture to make it consistent with the siwe message payload. If you want, I can revert it, but now it uses the right address

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll leave it as it is now (with the AI change)

Comment thread app/components/Views/confirmations/components/send/send.non-evm.view.test.tsx Outdated
Comment thread app/components/Views/confirmations/components/send/send.non-evm.view.test.tsx Outdated
Copy link
Copy Markdown
Contributor

@cryptotavares cryptotavares left a comment

Choose a reason for hiding this comment

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

The cv tests look good, however there are couple of e2e tests that should not be skipped.
Also why keeping the e2e tests as skipped? In my opinion we should just delete them (the ones that we have agreed that they could be moved to cv tests).

Comment thread tests/smoke/confirmations/send/send-erc20-token.spec.ts Outdated
Comment thread tests/smoke/confirmations/send/send-native-token.spec.ts Outdated
Comment thread tests/smoke/confirmations/transactions/gas-fee-tokens-eip-7702-sponsored.spec.ts Outdated
Comment thread tests/smoke/confirmations/transactions/gas-fee-tokens-eip-7702-sponsored.spec.ts Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

🔍 Smart E2E Test Selection

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

E2E Test Selection:
This PR is primarily a test infrastructure refactoring that moves E2E smoke tests to component-view (CV) tests. Key changes:

  1. SmokeConfirmations is needed because:

    • send-native-token.spec.ts was modified (simplified to only test MAX ETH send, removed 50% and 5 ETH sub-tests)
    • send-erc20-token.spec.ts was modified (removed 2 test cases: 5 USDC and 50% USDC sends)
    • send-solana-token.spec.ts was converted to it.skip (test body removed)
    • send-btc-token.spec.ts was converted to it.skip (test body removed)
    • alert-system.spec.ts was deleted entirely (moved to CV tests)
    • gas-fee-tokens-eip-7702-sponsored.spec.ts had a comment added (still runs)
    • status-icon.tsx changed test ID from hardcoded string to constant (minor but affects confirmations UI)
    • ConfirmationView.testIds.ts added new ConfirmationLoaderSelectorIDs
    • RedesignedSendView.testIds.ts added PERCENTAGE_BUTTON_50 test ID
    • confirm-data-helpers.ts added from field to SIWE fixture data
    • Need to verify the remaining E2E tests still pass after the refactoring
  2. SmokeNetworkAbstractions is needed because:

    • notification-settings-flow.spec.ts was converted to it.skip (test body removed)
    • enable-notifications-after-onboarding.spec.ts had a TODO comment added (still runs)
    • view-defi-details.spec.ts was deleted entirely (moved to CV tests)
    • view-market-insights.spec.ts was deleted entirely (moved to CV tests)
    • Need to verify the remaining notification E2E test still passes
  3. Not selected:

    • SmokeNetworkExpansion: Solana send test was skipped but no app code changes affect Solana flows
    • SmokeWalletPlatform: DeFi/market insights E2E tests deleted but no app code changes to those views
    • Other tags: No relevant app code changes

The changes are primarily test infrastructure (CV test additions, E2E test removals/skips), with minor app code changes to test IDs and fixtures. The remaining E2E tests in SmokeConfirmations and SmokeNetworkAbstractions need to be validated to ensure they still work correctly after the refactoring.

Performance Test Selection:
No performance-impacting changes. This PR is purely a test infrastructure refactoring - moving E2E tests to component-view tests, adding CV test helpers/presets/fixtures, and making minor test ID changes in app code. No changes to UI rendering, state management, data loading, or critical user flow performance paths.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

@racitores racitores enabled auto-merge May 6, 2026 16:37
@racitores racitores added this pull request to the merge queue May 7, 2026
Merged via the queue into main with commit 7281395 May 7, 2026
97 of 98 checks passed
@racitores racitores deleted the qa/e2e-cleanup branch May 7, 2026 07:58
@github-actions github-actions Bot locked and limited conversation to collaborators May 7, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.77.0 Issue or pull request that will be included in release 7.77.0 label May 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.77.0 Issue or pull request that will be included in release 7.77.0 size-XL skip-e2e-flakiness-detection Skips the E2E flakiness detection (extra runs on new and modified E2E files) team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants