Skip to content

test: remove toMatchSnapshot and removed snapshot files in card tests#28675

Merged
cortisiko merged 3 commits intomainfrom
MMQA-1685
Apr 10, 2026
Merged

test: remove toMatchSnapshot and removed snapshot files in card tests#28675
cortisiko merged 3 commits intomainfrom
MMQA-1685

Conversation

@cortisiko
Copy link
Copy Markdown
Member

@cortisiko cortisiko commented Apr 10, 2026

Description

Removes snapshot-based assertions from several Card UI tests (CardAuthentication, CardHome, AddFundsBottomSheet) and replaces them with explicit checks for key text/test IDs.

Cleans up tests to use toBeOnTheScreen() for presence/absence assertions (replacing toBeNull()/truthy checks) and deletes the now-unused Jest snapshot files.

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

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 because changes are limited to test expectations and snapshot cleanup, with no production code modifications.

Overview
Removes toMatchSnapshot() assertions from several Card UI tests (CardAuthentication, CardHome, AddFundsBottomSheet) and deletes the now-unused __snapshots__ files.

Updates assertions to be more explicit and stable by checking for key text/test IDs with toBeOnTheScreen() (including absence checks replacing toBeNull()/truthy expectations).

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

@cortisiko cortisiko requested a review from a team as a code owner April 10, 2026 14:46
@metamaskbot metamaskbot added the team-qa QA team label Apr 10, 2026
@cortisiko cortisiko added no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed and removed size-M labels Apr 10, 2026
@github-actions github-actions bot added the risk-low Low testing needed · Low bug introduction risk label Apr 10, 2026
Copy link
Copy Markdown

@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 96786ee. Configure here.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.89%. Comparing base (9f195d0) to head (96786ee).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main   #28675       +/-   ##
===========================================
- Coverage   82.14%   57.89%   -24.26%     
===========================================
  Files        4949     4949               
  Lines      130070   130063        -7     
  Branches    29004    29003        -1     
===========================================
- Hits       106851    75304    -31547     
- Misses      15923    48660    +32737     
+ Partials     7296     6099     -1197     

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

@github-actions github-actions bot added size-M risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Apr 10, 2026
@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: 98%
click to see 🤖 AI reasoning details

E2E Test Selection:
All 31 changed files are exclusively unit test files (.test.tsx) and their associated snapshot files (snapshots/.snap) within the app/components/UI/Card/ directory. No production application code was modified.

The changes are purely test quality improvements:

  1. Replacing snapshot-based assertions (toMatchSnapshot(), toJSON()) with explicit behavioral assertions using toBeOnTheScreen()
  2. Replacing toBeNull() with not.toBeOnTheScreen() for better testing semantics
  3. Removing obsolete snapshot files that are no longer needed
  4. Renaming test descriptions to remove "matches snapshot" wording

Since no production code, E2E test infrastructure, controllers, navigation, shared components, or app logic was changed, there is no need to run any E2E test tags. These unit test refactoring changes cannot affect E2E test outcomes.

Performance Test Selection:
All changes are confined to unit test files only. No production code, UI components, state management, or app logic was modified. There is no performance impact from these test refactoring changes.

View GitHub Actions results

@cortisiko cortisiko enabled auto-merge April 10, 2026 15:56
@sonarqubecloud
Copy link
Copy Markdown

@cortisiko cortisiko added this pull request to the merge queue Apr 10, 2026
Merged via the queue into main with commit 9bd66ad Apr 10, 2026
63 checks passed
@cortisiko cortisiko deleted the MMQA-1685 branch April 10, 2026 16:18
@github-actions github-actions bot locked and limited conversation to collaborators Apr 10, 2026
@metamaskbot metamaskbot added the release-7.74.0 Issue or pull request that will be included in release 7.74.0 label Apr 10, 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.74.0 Issue or pull request that will be included in release 7.74.0 risk-low Low testing needed · Low bug introduction risk size-M team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants