test: pr for tests refactor related to #355#358
Merged
gabrieledm merged 6 commits intoJul 14, 2026
Conversation
…e-and-incomplete' into test/WPN-454_transaction-gas-fee-estimation-is-inaccurate-and-incomplete
…e-and-incomplete' into test/WPN-454_transaction-gas-fee-estimation-is-inaccurate-and-incomplete
…e-and-incomplete' into test/WPN-454_transaction-gas-fee-estimation-is-inaccurate-and-incomplete
…e-and-incomplete' into test/WPN-454_transaction-gas-fee-estimation-is-inaccurate-and-incomplete
…e-and-incomplete' into test/WPN-454_transaction-gas-fee-estimation-is-inaccurate-and-incomplete
07a7f4d
into
fix/WPN-454_transaction-gas-fee-estimation-is-inaccurate-and-incomplete
12 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
Split PR for test refactor from the original one #355.
References
Checklist
Note
Low Risk
Test-only changes and minor coverage config updates; no production logic modified in this diff.
Overview
Refactors large Jest suites to avoid shared
beforeEachstate by introducing per-test setup helpers and stricter mocks, and adds coverage for fee UI and TRX amount parsing. Jest coverage thresholds are nudged up slightly to match the new tests.FeeCalculatorService.test.tsdrops module-levelas anymocks (including TronWeb) in favor of typed partial mocks and awithFeeCalculatorServicewrapper that builds a fresh service and dependencies for each case. Smart-contract simulation mocks now attachreton a spread of the real transaction instead of minimal stub objects.ConfirmSignTransaction/rendertests use a similarwithSnapContextpattern with typedSnapClient, scan, assets, and fee calculator mocks. Context fixtures includeisInsufficientBalance, with new cases asserting confirm is blocked and “Insufficient funds” is shown, and thatrendersetsisInsufficientBalance: truewhen TRX cannot cover value plus fees.transaction.test.tsadds tests forgetTransactionTrxValue: native transfers, smart-contractcall_value, and non-TRX asset transfers returning zero.Reviewed by Cursor Bugbot for commit 2919740. Bugbot is set up for automated code reviews on this repo. Configure here.