Skip to content

refactor: move analytics data deletion out of MetaMetrics (3/4 web3auth)#26025

Merged
NicolasMassart merged 4 commits intomainfrom
refactor/25767_Move_analytics_data_deletion_web3auth_split_3-4
Feb 16, 2026
Merged

refactor: move analytics data deletion out of MetaMetrics (3/4 web3auth)#26025
NicolasMassart merged 4 commits intomainfrom
refactor/25767_Move_analytics_data_deletion_web3auth_split_3-4

Conversation

@NicolasMassart
Copy link
Copy Markdown
Contributor

@NicolasMassart NicolasMassart commented Feb 12, 2026

Description

Part 3/4 of #25767Code owner: web3auth

Independent — can merge in any order.

Removes unused MetaMetrics deletion mock methods from the Onboarding component test. The Onboarding test never calls or asserts on createDataDeletionTask, checkDataDeleteStatus, getDeleteRegulationCreationDate, getDeleteRegulationId, isDataRecorded, updateDataRecordingFlag, or configure, so these mock properties are dead code.

What changed:

  • Onboarding/index.test.tsx — simplified MetaMetrics.getInstance() mock from an object with 7 unused deletion stubs to an empty object {}.

Changelog

CHANGELOG entry: null

Related issues

Fixes #25767
Fixes https://consensyssoftware.atlassian.net/browse/MCWP-297

Manual testing steps

N/A — test-only change.

Screenshots/Recordings

N/A — test-only change.

Before

N/A

After

N/A

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
Test-only change that simplifies a Jest mock; no production code or runtime behavior is affected.

Overview
Simplifies Onboarding/index.test.tsx by trimming the MetaMetrics.getInstance() Jest mock from a set of unused data-deletion stubs to an empty object, reducing dead test setup tied to analytics deletion APIs.

Written by Cursor Bugbot for commit 3174a65. This will update automatically on new commits. Configure here.

Simplify MetaMetrics mock in Onboarding tests by removing
deletion-related methods that are never called or asserted.
@NicolasMassart NicolasMassart self-assigned this Feb 12, 2026
@NicolasMassart NicolasMassart requested a review from a team as a code owner February 12, 2026 16:54
@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-mobile-platform Mobile Platform team label Feb 12, 2026
@NicolasMassart NicolasMassart changed the title refactor: move analytics data deletion out of MetaMetrics (2/4 web3auth) refactor: move analytics data deletion out of MetaMetrics (3/4 web3auth) Feb 12, 2026
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.15%. Comparing base (fdc50e0) to head (d7640d2).
⚠️ Report is 95 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #26025      +/-   ##
==========================================
+ Coverage   80.70%   81.15%   +0.44%     
==========================================
  Files        4361     4389      +28     
  Lines      113120   113438     +318     
  Branches    24093    24397     +304     
==========================================
+ Hits        91296    92055     +759     
+ Misses      15476    14989     -487     
- Partials     6348     6394      +46     

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

@NicolasMassart NicolasMassart added the DO-NOT-MERGE Pull requests that should not be merged label Feb 12, 2026
@NicolasMassart
Copy link
Copy Markdown
Contributor Author

wait for #26023 to merge

@NicolasMassart NicolasMassart added team-onboarding Onboarding team and removed DO-NOT-MERGE Pull requests that should not be merged labels Feb 13, 2026
@NicolasMassart NicolasMassart requested a review from ieow February 14, 2026 10:32
@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:
The change is purely a unit test modification in app/components/Views/Onboarding/index.test.tsx. The diff shows a simplification of a Jest mock for MetaMetrics.getInstance() - removing mock implementations for several methods (createDataDeletionTask, checkDataDeleteStatus, getDeleteRegulationCreationDate, getDeleteRegulationId, isDataRecorded, updateDataRecordingFlag) that are no longer needed in the test.

This is a test-only change that:

  1. Only modifies a unit test file (.test.tsx), not production code
  2. Does not change any E2E test infrastructure or page objects
  3. Does not affect the actual Onboarding component behavior
  4. Simply cleans up/simplifies a mock that was providing unnecessary method stubs

Since no production code is changed and this is purely a unit test mock cleanup, no E2E tests need to be run to validate this change. The unit tests themselves will validate that the mock simplification doesn't break the test suite.

Performance Test Selection:
This change only modifies a unit test file by simplifying a Jest mock. No production code is changed, so there is no potential impact on app performance. No performance tests are needed.

View GitHub Actions results

Copy link
Copy Markdown
Contributor

@ieow ieow left a comment

Choose a reason for hiding this comment

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

lgtm

@sonarqubecloud
Copy link
Copy Markdown

@NicolasMassart NicolasMassart added this pull request to the merge queue Feb 16, 2026
Merged via the queue into main with commit 8ae5667 Feb 16, 2026
58 checks passed
@NicolasMassart NicolasMassart deleted the refactor/25767_Move_analytics_data_deletion_web3auth_split_3-4 branch February 16, 2026 18:03
@github-actions github-actions bot locked and limited conversation to collaborators Feb 16, 2026
@metamaskbot metamaskbot added the release-7.67.0 Issue or pull request that will be included in release 7.67.0 label Feb 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.67.0 Issue or pull request that will be included in release 7.67.0 size-XS team-mobile-platform Mobile Platform team team-onboarding Onboarding team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Move analytics data deletion out of MetaMetrics into dedicated util and hook

4 participants