Skip to content

test: adds transaction_hash coverage in Transaction Finalized event#24591

Merged
christopherferreira9 merged 2 commits intomainfrom
cferreira/add-txhash-transaction-coverage
Jan 15, 2026
Merged

test: adds transaction_hash coverage in Transaction Finalized event#24591
christopherferreira9 merged 2 commits intomainfrom
cferreira/add-txhash-transaction-coverage

Conversation

@christopherferreira9
Copy link
Copy Markdown
Contributor

@christopherferreira9 christopherferreira9 commented Jan 15, 2026

Description

Adds coverage for transaction_hash property in Transaction Finalized event.

Additions

  • added getLatestBlockNumber, getBlockByNumber to Anvil Manager

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

Adds automated validation that analytics report the correct transaction_hash.

  • New metricsValidationHelper checks Transaction Finalized event’s transaction_hash against the latest tx from the local Anvil node
  • Extends AnvilManager with getLatestBlockNumber and getBlockByNumber
  • Introduces LOCAL_NODE_RPC_URL for consistent local RPC configuration
  • Adds remoteFeatureFlagExtensionUxPna25 mock and sets up related remote feature flag/auth mocks in tests
  • Updates send-native-token.spec to use local RPC, opt into MetaMetrics, and run the new validation

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

@christopherferreira9 christopherferreira9 added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Jan 15, 2026
@christopherferreira9 christopherferreira9 requested a review from a team as a code owner January 15, 2026 20:32
@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-qa QA team label Jan 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeConfirmationsRedesigned
  • Risk Level: medium
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

All changes in this PR are E2E test infrastructure modifications:

  1. e2e/api-mocking/mock-responses/feature-flags-mocks.ts: Added a new feature flag mock remoteFeatureFlagExtensionUxPna25 - this is a simple addition to the test mocking infrastructure.

  2. e2e/framework/Constants.ts: Added LOCAL_NODE_RPC_URL constant for standardized local node RPC URL usage in fixtures.

  3. e2e/seeder/anvil-manager.ts: Added two new utility methods (getLatestBlockNumber() and getBlockByNumber()) to the Anvil local node manager for retrieving block information.

  4. e2e/specs/send/metricsValidationHelper.ts: New helper file for validating transaction hashes in analytics events.

  5. e2e/specs/send/send-native-token.spec.ts: Modified test that uses the new infrastructure - this test is explicitly tagged with SmokeConfirmationsRedesigned.

The changes don't modify any application code - they only enhance the E2E testing framework. The modified test file (send-native-token.spec.ts) is tagged with SmokeConfirmationsRedesigned, so running this tag will validate that:

  • The new LOCAL_NODE_RPC_URL constant works correctly
  • The new anvil-manager methods function properly
  • The new metrics validation helper works as expected
  • The feature flag mock is properly integrated

This is a focused change to test infrastructure with clear impact on the SmokeConfirmationsRedesigned test suite.

View GitHub Actions results

Copy link
Copy Markdown
Member

@cortisiko cortisiko left a comment

Choose a reason for hiding this comment

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

🌮 🌮

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.82%. Comparing base (42a758f) to head (d7898eb).
⚠️ Report is 28 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24591      +/-   ##
==========================================
+ Coverage   79.61%   79.82%   +0.20%     
==========================================
  Files        4191     4190       -1     
  Lines      107856   107235     -621     
  Branches    22185    22338     +153     
==========================================
- Hits        85873    85602     -271     
+ Misses      15987    15627     -360     
- Partials     5996     6006      +10     

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

@sonarqubecloud
Copy link
Copy Markdown

@christopherferreira9 christopherferreira9 added this pull request to the merge queue Jan 15, 2026
Merged via the queue into main with commit 0aaac81 Jan 15, 2026
148 of 158 checks passed
@christopherferreira9 christopherferreira9 deleted the cferreira/add-txhash-transaction-coverage branch January 15, 2026 23:26
@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2026
@metamaskbot metamaskbot added the release-7.63.0 Issue or pull request that will be included in release 7.63.0 label Jan 15, 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.63.0 Issue or pull request that will be included in release 7.63.0 size-M team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants