Add comprehensive SendTokensScreen tests (Closes #82) - #120
Open
Codex723 wants to merge 1 commit into
Open
Conversation
cybermax4200
requested changes
Aug 25, 2026
cybermax4200
left a comment
Contributor
There was a problem hiding this comment.
your branch naming does'nt follow the repo convention
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.
Title: Add comprehensive test coverage for SendTokensScreen
Closes #82
Summary
This PR adds full test coverage for
src/screens/SendTokensScreen.tsx, which was previously untested despite handling the entire payment flow. It covers input validation, destination/amount/asset handling, the Lobstr delegation path vs. the in-app signing path, error handling, and success confirmation display.Changes
src/__tests__/SendTokensScreen.test.tsxwith 19 test cases (acceptance criteria required 10+).Coverage highlights
payURI with trimmed args, shows the "Payment opened in Lobstr" confirmation alert, clears the inputs, and refreshes balances after the 3s delay (fake timers); error path whenLobstrNotInstalledErroris thrown.getInAppSecret+signAndSubmitPaymentcalled with the correct params, success alert with the truncated transaction hash, balance refresh, and input clearing; missing-secret-key error path.op_no_trustmaps to the friendly trustline message.goBack.Testing
npm test): 43 suites / 380 tests passedtsc --noEmit): clean (0 errors)no-floating-promiseswarnings already present in existing tests)Notes
jest.mockforuseWalletStore,useStellarWallet,getInAppSecret,signAndSubmitPayment,isValidAmount,isValidPublicKey,openLobstrForPayment/LobstrNotInstalledError,@react-navigation/native;Alertspy;react-test-renderer+act).react-native-configis mocked with inline values (matchinguseStellarWallet.test.tsx) so the ECO/USDC asset paths can run.