Skip to content

test: remove toMatchSnapshot and removed snapshot files in notifications tests#29329

Merged
cortisiko merged 3 commits into
mainfrom
MMQA-1687
Apr 24, 2026
Merged

test: remove toMatchSnapshot and removed snapshot files in notifications tests#29329
cortisiko merged 3 commits into
mainfrom
MMQA-1687

Conversation

@cortisiko
Copy link
Copy Markdown
Member

@cortisiko cortisiko commented Apr 24, 2026

Description

Removes Jest snapshot coverage for several notification detail components and deletes the associated .snap files.

Updates NotificationBadge, NetworkFeeField, and Header tests to assert specific rendered output instead of toMatchSnapshot() (e.g., presence of key testIDs and title/description text, and explicitly expecting null renders where applicable).

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 that remove snapshot reliance; low product risk but may reduce coverage of UI regressions previously caught by snapshots.

Overview
Removes Jest snapshot files for several notification components and updates their tests to stop using toMatchSnapshot().

Tests now assert specific rendered output instead (e.g., presence of key testIDs/text) and explicitly check null rendering for NetworkFeeField where applicable.

Reviewed by Cursor Bugbot for commit dbddff4. 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 24, 2026 14:01
@cortisiko cortisiko added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Apr 24, 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 2 potential issues.

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 76b0ed5. Configure here.

Comment thread app/components/Views/Notifications/Details/Title/index.test.tsx Outdated
Comment thread app/components/Views/Notifications/Details/Badge/index.test.tsx Outdated
@metamaskbotv2 metamaskbotv2 Bot added the team-qa QA team label Apr 24, 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: 99%
click to see 🤖 AI reasoning details

E2E Test Selection:
All 10 changed files are unit test files (.test.jsx, .test.tsx) and their associated snapshot files (snapshots/*.snap) for Notification components. The changes are purely unit test refactoring — migrating from snapshot-based assertions (toMatchSnapshot()) to explicit element-based assertions (getByTestId(), getByText(), toBeOnTheScreen()). No application source code was modified, no E2E test infrastructure was touched, no controllers or Engine code was changed, and no shared components that could affect E2E test flows were altered. These changes have zero impact on E2E test behavior and do not require any E2E test tags to be run.

Performance Test Selection:
No application source code was changed — only unit test files and snapshot files were modified. There is no performance impact from refactoring unit test assertions, so no performance tests are needed.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@cortisiko cortisiko added this pull request to the merge queue Apr 24, 2026
Merged via the queue into main with commit ddb3c81 Apr 24, 2026
64 checks passed
@cortisiko cortisiko deleted the MMQA-1687 branch April 24, 2026 16:12
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 24, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.76.0 Issue or pull request that will be included in release 7.76.0 label Apr 24, 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.76.0 Issue or pull request that will be included in release 7.76.0 size-S team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants