test: add unit tests for TransactionDetailsSheet component
Description
Adds a co-located unit test for TransactionDetailsSheet to cover the live transaction selector path. The sheet now has regression coverage proving it uses the latest transaction metadata from Redux when selectTransactionMetadataById finds a matching transaction, and falls back to the route transaction when Redux does not have a match.
The test renders the real sheet/header/details component tree and asserts the displayed transaction date follows the selected transaction source.
Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-881
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
- [x] I've followed MetaMask Contributor Docs and MetaMask Mobile Coding Standards.
- [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 format if applicable
- [x] I've applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
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
- See
trace()for usage andaddTokenfor an example
- See
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 addition with no runtime or user-facing behavior changes.
Overview Adds a new co-located test file for
TransactionDetailsSheetwith no production code changes.The tests render the real sheet via
renderScreen, stub navigation route params andtoDateFormat, and seedTransactionControllertransactions in Redux. They lock in two behaviors: whenselectTransactionMetadataByIdfinds a matching id, the UI shows the live transaction timestamp (not stale route data or unrelated txs); when Redux has no match, it falls back to the routetx.Reviewed by Cursor Bugbot for commit 973203a734db07e1c8323cac04bd64e570da98a2. Bugbot is set up for automated code reviews on this repo. Configure here.
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.
PR template — items to address before "Ready for review"
Warnings — informational, address before merging:
Manual testing stepsstill contain template content (the Gherkin example title or a[...]placeholder). Replace with real steps, or writeN/A — <reason>.Screenshots/Recordingssection is empty. Add an image/video for user-facing changes, logs/console output for non-user-facing changes, or writeN/Aif no evidence is applicable.Pre-merge author checklisthas unchecked items (e.g. "I've tested on Android"). Every box must be consciously checked — seedocs/readme/ready-for-review.md.
See docs/readme/ready-for-review.md for the full Definition of Ready for Review.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code