Skip to content

Commit 8fad90c

Browse files
refactor: move analytics data deletion out of MetaMetrics (4/4 wallet-integrations) (MetaMask#26026)
## **Description** Part 4/4 of MetaMask#25767 — **Code owner: wallet-integrations** > **Independent** — can merge in any order. Removes `updateDataRecordingFlag` from the MetaMetrics mock in `ethereum-chain-utils.test.ts`. The production code (`ethereum-chain-utils.js`) only calls `MetaMetrics.getInstance().trackEvent()` — it never references `updateDataRecordingFlag`, making this mock property dead code. **What changed:** - **`ethereum-chain-utils.test.ts`** — removed `updateDataRecordingFlag: jest.fn()` from the `MetaMetrics.getInstance()` mock (1 line deleted). ## **Changelog** CHANGELOG entry: null ## **Related issues** This one is fixing the issue (PR 4 on 4): Fixes: MetaMask#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** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Test-only cleanup that removes dead mocking with no runtime behavior changes. > > **Overview** > Cleans up the `switchToNetwork` analytics test by removing the unused `updateDataRecordingFlag` stub from the `MetaMetrics.getInstance()` mock in `ethereum-chain-utils.test.ts`. > > No production logic changes; the test now only mocks `trackEvent`, matching actual usage in `ethereum-chain-utils.js`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c38c8c6. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent b3b22b3 commit 8fad90c

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

app/core/RPCMethods/lib/ethereum-chain-utils.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ describe('switchToNetwork', () => {
3030
const mockTrackEvent = jest.fn();
3131
(MetaMetrics.getInstance as jest.Mock).mockReturnValue({
3232
trackEvent: mockTrackEvent,
33-
updateDataRecordingFlag: jest.fn(),
3433
});
3534

3635
const mockAddProperties = jest.fn().mockReturnThis();

0 commit comments

Comments
 (0)