Repository navigation
test(escrow): unit tests for high-value cargo multi-sig modal - #906
Merged
Merged
Conversation
Adds 33 unit tests for HighValueCargoMultiSigModal with the useHighValueCargoApproval hook mocked. Hook state is derived from the shared recorded API response fixtures, so every render state can be driven directly: loading, load error and retry, signer list, cross-border risk banner, deadline countdown and expiry, signature threshold gating, acknowledgement, submission and closing. Keyboard coverage includes Escape, Space on the acknowledgement, Tab and Shift+Tab focus trapping, and focus restoration to the trigger. Depends on the modal, hook and fixtures from SwiftChainn#901.
|
@Deb-Auth Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Deb-Auth
marked this pull request as ready for review
September 29, 2026 15:20
Deb-Auth
marked this pull request as draft
September 29, 2026 15:47
Deb-Auth
marked this pull request as ready for review
September 30, 2026 23:40
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.
Closes #794
Summary
Adds unit tests for
HighValueCargoMultiSigModalwith theuseHighValueCargoApprovalhook mocked, covering render states, signature threshold logic, the acknowledgement flow, the deadline countdown and keyboard accessibility.Depends on #901
The modal, hook and API response fixtures under test are introduced by #901, which is not merged yet. This PR is opened as a draft and contains only the test file. Until #901 lands, this suite cannot resolve its imports on
main. After #901 merges I will rebase this branch and mark it ready for review.#901 also adds a service-level test file at
components/escrow/__tests__/HighValueCargoMultiSigModal.test.tsx, the same path this issue specifies. When rebasing, I'll keep both suites by moving #901's version toHighValueCargoMultiSigModal.integration.test.tsx.What is tested
33 test cases in
components/escrow/__tests__/HighValueCargoMultiSigModal.test.tsx:Acceptance criteria
useHighValueCargoApproval:jest.mockon the hook module;formatCountdownstays real.HighValueCargoMultiSigModal.tsxat 100% statements, 100% lines, 100% functions, 98.59% branches. The one uncovered branch shortens keys of 12 characters or fewer, which Stellar public keys never are.hooks/__tests__/fixtures/highValueCargoApiResponses.tsfrom feat(escrow): create high-value cargo multi-signature approval modal #901.Screenshots
All tests passing with coverage, run with #901 applied:
Notes
CI on
maincurrently fails at the Lint step due to existing errors inapp/page.tsx,components/escrow/__tests__/CheckoutFlow.keyboard.test.tsxand__tests__/landingPage.test.tsx(details in #794). Until #901 is merged, this PR's own test file will also fail to import onmain.Disclosure
AI assistance (Claude) was used to write these tests. Tests were run and pass locally with #901 applied.