Skip to content

chore: reset 58 unrelated test changes to match main#29532

Open
andrepimenta wants to merge 1 commit intorn-upgrade/0.81.5-no-unit-testsfrom
rn-upgrade/0.81.5-reset-tests-to-main
Open

chore: reset 58 unrelated test changes to match main#29532
andrepimenta wants to merge 1 commit intorn-upgrade/0.81.5-no-unit-testsfrom
rn-upgrade/0.81.5-reset-tests-to-main

Conversation

@andrepimenta
Copy link
Copy Markdown
Member

@andrepimenta andrepimenta commented Apr 29, 2026

Resets test files whose diffs versus main are not part of the React Native 0.81.5 upgrade (feature work, unrelated refactors, removed/renamed tests, mocks that no longer match production types). Categorisation lives in .metamask/audit_tests_changes.md.

Breakdown:

  • 54 modified test files restored to main (URL-constant inlining, selector renames that don't match production, removed/renamed tests, property renames such as account_type -> flow_type, broken Skeleton mock paths, stripped mock fields the production type still requires, buildMessengerClientInitRequestMock -> buildControllerInitRequestMock rename across the 9 controller-init tests + test-utils.ts even though app/core/Engine/types.ts still exports getMessengerClient, etc.).
  • 1 deleted test restored: app/util/identity/hooks/useBrazeIdentity/useBrazeIdentity.test.ts
  • 3 added-on-branch tests removed:
    • app/components/UI/Rewards/components/Onboarding/RewardsIntroModal.test.tsx
    • app/selectors/featureFlagController/legalNotices/index.test.ts
    • app/selectors/featureFlagController/tokenDetailsV2/index.test.ts

The 10 'Keep' files (the 5 RN-driven snapshot regenerations, testSetup.js / testSetupView.js mock plumbing, initial-background-state.json marketOverview cleanup, tests/component-view/mocks.ts Easing reshape, and tests/page-objects/wallet/AccountListBottomSheet.ts E2E flake fix) are left untouched.

Description

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
Test-only changes plus test utilities/mocks updates; low product risk, with main risk being missed regressions if restored expectations no longer reflect runtime behavior.

Overview
Aligns numerous unit tests and mocks back to current main expectations, including updated selectors/feature-flag wiring, navigation params, and stable URL usage via shared constants.

Updates multiple test doubles to match production interfaces (e.g., Earn adds tron_staking, Perps adds diskCache and stream getSnapshot/prewarm methods, Engine controller init tests switch to buildMessengerClientInitRequestMock/getMessengerClient) and refreshes assertions/snapshots around analytics properties (e.g., Home viewed app_session_id/visit_number, ramps asset_symbol, wallet-creation error CTAs) and UI header behavior (SimpleWebview).

Removes a handful of branch-only tests and obsolete feature-flag gating assertions (e.g., PNA25 flag checks), and adjusts/extends tests around QR hardware marketing suppression, tooltip dismissal behavior, and app-state open tracking edge cases.

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

Resets test files whose diffs versus main are not part of the React
Native 0.81.5 upgrade (feature work, unrelated refactors, removed/renamed
tests, mocks that no longer match production types). Categorisation lives
in `.metamask/audit_tests_changes.md`.

Breakdown:
- 54 modified test files restored to main (URL-constant inlining,
  selector renames that don't match production, removed/renamed tests,
  property renames such as account_type -> flow_type, broken Skeleton
  mock paths, stripped mock fields the production type still requires,
  buildMessengerClientInitRequestMock -> buildControllerInitRequestMock
  rename across the 9 controller-init tests + test-utils.ts even though
  app/core/Engine/types.ts still exports getMessengerClient, etc.).
- 1 deleted test restored: app/util/identity/hooks/useBrazeIdentity/useBrazeIdentity.test.ts
- 3 added-on-branch tests removed:
  - app/components/UI/Rewards/components/Onboarding/RewardsIntroModal.test.tsx
  - app/selectors/featureFlagController/legalNotices/index.test.ts
  - app/selectors/featureFlagController/tokenDetailsV2/index.test.ts

The 10 'Keep' files (the 5 RN-driven snapshot regenerations,
testSetup.js / testSetupView.js mock plumbing, initial-background-state.json
marketOverview cleanup, tests/component-view/mocks.ts Easing reshape, and
tests/page-objects/wallet/AccountListBottomSheet.ts E2E flake fix) are
left untouched.
@andrepimenta andrepimenta requested review from a team as code owners April 29, 2026 23:53
@metamaskbotv2 metamaskbotv2 Bot added the team-mobile-platform Mobile Platform team label Apr 29, 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.

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 7a420ca. Configure here.

import React from 'react';
import renderWithProvider from '../../../../../util/test/renderWithProvider';
import networkImage from '../../../../../images/ethereum.png';
import networkImage from '../../../../images/ethereum.png';
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.

Wrong relative import path for ethereum.png image

High Severity

The import path ../../../../images/ethereum.png resolves to app/features/images/ethereum.png, which does not contain ethereum.png. The file exists at app/images/ethereum.png. The original path with five ../ segments was correct; removing one level breaks the import and will cause the test to fail at build/runtime.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7a420ca. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
All 58 changed files are exclusively unit test files (.test.ts, .test.tsx), mock data files (mocks/), and snapshot files (snapshots/). There are zero production code changes in this PR.

Key changes analyzed:

  1. Test utility rename (test-utils.ts): buildControllerInitRequestMockbuildMessengerClientInitRequestMock, getControllergetMessengerClient. Pure rename affecting 8 controller init test files - no production impact.
  2. Controller init tests (ai-digest, gator-permissions, keyring, multichain-account-service, multichain-assets-rates, ramps-service, storage-service, token-rates): All updating to use renamed test utility. No production code changes.
  3. Feature flag test deletions: legalNotices/index.test.ts and tokenDetailsV2/index.test.ts deleted - these reflect removal of the selectIsPna25FlagEnabled feature flag from production (already merged separately).
  4. Hash/Security metrics tests: Removing selectIsPna25FlagEnabled mock references - PNA25 flag removed from production code.
  5. Homepage tests: Selector rename mock updates, new HomepageScrollContext tests, new useTopTraders mock.
  6. Perps/Earn mocks: Adding new stream manager channels and tron_staking field to mock data.
  7. Confirmations tests: New predictDepositAndOrder transaction type test cases.
  8. Hardware wallet tests: New Keystone/OneKey button test IDs, hideMarketingContent prop tests.
  9. Social login/onboarding tests: Analytics property updates (account_type, error_type, cta_type).
  10. AppStateEventListener test: iOS background→inactive→active transition test cases.

Since no production code is modified, E2E tests cannot be broken by these changes. Running E2E tests would not validate anything specific to these test-only changes. No performance tests are needed either as no UI rendering, data loading, or app initialization code was modified.

Performance Test Selection:
All changes are exclusively in test files and mock data. No production code affecting UI rendering, data loading, state management, or app initialization was modified. Performance tests are not warranted.

View GitHub Actions results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant