test(wallet): add RTL assertions for wallet_selector_modal (#232) - #298
test(wallet): add RTL assertions for wallet_selector_modal (#232)#298MAN7A-afk wants to merge 4 commits into
Conversation
- Add DEFAULT_SIGNING_TIMEOUT_MS = 60_000 configurable constant - Add TxSignRequest interface, TxSignatureTimeoutError class, clearTxSensitiveMemory helper, and signTxWithTimeout function to app/lib/transactions.ts, matching the setTimeout + Promise.race pattern used by all other connector helpers in the codebase - Wire signTxWithTimeout into submitContractTransaction via optional signingTimeoutMs param (defaults to the constant); on timeout the operation is aborted and any sensitive payload memory is zeroed - Add __tests__/transactions_timeout.test.ts with 21 test cases covering: timeout fires, memory cleared, successful signing flow, pre-deadline no-early-fire, timer cleanup, error propagation, default constant, TxSignatureTimeoutError class, and clearTxSensitiveMemory helper
|
@MAN7A-afk 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! 🚀 |
fddba24 to
4e942aa
Compare
|
Thanks @MAN7A-afk — your #296, #297 and #301 all landed (GitHub closed #296/#297 as merged once their commit became reachable through #301, so they're credited). This one I'm holding, because it can't stand on its own against current This PR doesn't include the component its tests need. Its diff against its own base touches only function openModal() {
fireEvent.click(screen.getByTestId("wallet-selector-modal-trigger"));
}
render(<WalletSelectorModal {...defaultProps({ selectedWalletId: "albedo" })} />);That design — internal Why the controlled design won: #355 (design tokens) and the availability/rejection suites on The 35 assertions here are genuinely good and cover ground Suggested path: rebase on
Also worth knowing for next time: #296 and #297 were opened with maintainer edits disabled (#296 from your fork's default branch), so I couldn't refresh their branches or re-run CI against current |
|
@MAN7A-afk — closing this one, and I want to be straight about why, because the problem isn't the code you wrote. The component these tests target was never merged. I re-measured against current
Of the 35 That surface came from the shared branch behind #296/#297. Those merged, but the self-managing modal they carried was superseded by the controlled Why I'm not building it to make this mergeable: What was genuinely good here: the assertions themselves. The multi-sig toggle behaviour, the XDR validation gate, the assembly plan, and especially the modal-state-reset-on-close cases cover ground nothing else does. If you want to bring that rigour to the code that is on Your #296, #297 and #301 all landed and are credited. Sorry this one ran aground on merge ordering rather than on anything you did. One practical note for next time: #296 was opened from your fork's default branch with maintainer edits disabled, so I couldn't refresh it against |
Description:
Closes #232
Adds React Testing Library assertions for
WalletSelectorModalcovering trigger actions under mocked wallet state, beyond the baseline coverage already in place.New coverage added:
onConnectselectedWalletIdproparia-labelledby, correctly pointing at the modal titleonMultiSigPlanReadyis not called when the build-plan action has no signersonConnectandonSelectWalletare asserted to fire exactly as expected under mocked wallet actionsTesting:
__tests__/wallet_selector_modal.test.tsx: 35/35 passing (20 existing + 15 new)next/*module resolution errors unrelated to this change)No source files were modified — this is test-only.