test: increase unit test coverage for bridge-status-controller#8186
Merged
test: increase unit test coverage for bridge-status-controller#8186
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
bd27c27 to
2922251
Compare
micaelae
commented
Mar 11, 2026
| error.failures().forEach(({ branch, path }) => { | ||
| error.failures().forEach(({ path }) => { | ||
| const aggregatorId = | ||
| branch?.[0]?.quote?.bridgeId ?? |
Member
Author
There was a problem hiding this comment.
These lines don't apply to statuses because they don't have a quote field
micaelae
commented
Mar 11, 2026
| clientId: string, | ||
| ): Promise<IntentOrder> { | ||
| clientId: BridgeClientId, | ||
| ): Promise<IntentStatusResponse> { |
Member
Author
There was a problem hiding this comment.
Renamed the intent order response type to align with getTxStatus's, and also narrowed types for the function params
micaelae
commented
Mar 11, 2026
| const requireApproval = | ||
| isHardwareAccount && this.#clientId === BridgeClientId.MOBILE; | ||
| // Handle approval silently for better UX in intent flows | ||
| const approvalTxMeta = await this.#handleApprovalTx( |
Member
Author
There was a problem hiding this comment.
handleApprovalTx does the approval check so removing the parent if statement
ghgoodreau
approved these changes
Mar 12, 2026
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
Adding unit tests to bump the test coverage of the bridge-status-controller and bridge-status-controller.intent modules to 100%. This is a prep step for the upcoming
submitTxrefactor to ensure existing functionality is preservedReferences
Checklist
Note
Medium Risk
Mostly test/mocking changes, but it also tweaks transaction submission/polling behavior (intent API typing, approval handling, and txFee conversion), which could affect swap/bridge execution paths if edge cases are missed.
Overview
Raises
bridge-status-controllertest coverage to 100% by adding extensive unit tests and new snapshots around intent polling/syncing and EVMsubmitTxscenarios (gas-included fees, 7702 batch path precedence, approvals/gasless swaps).Includes small functional hardening/refactors to support the tests: intent API and
IntentManagernow use typedBridgeClientIdand numericChainId, approval handling only processes EVMapprovaldata and can require explicit approval confirmation for mobile hardware wallets, gas fee selection uses quotetxFeevalues directly (no?? 0fallback), and bridge-status validation failure attribution is simplified. Coverage thresholds were tightened/enforced injest.config.js, and the changelog was updated.Written by Cursor Bugbot for commit e27a99f. This will update automatically on new commits. Configure here.