Skip to content

Conversation

@jimenezz22
Copy link
Contributor

@jimenezz22 jimenezz22 commented Oct 4, 2024

Closes #13

@ElliotFriend

Unit tests added for horizonQueries.js:

fetchAccount.test.js

  • Verifies that, given a valid publicKey, the function returns the account details.
  • Test with an invalid publicKey that should throw an error with the message "invalid public key".
  • Simulate an unfunded account (status 404) and throw an appropriate error.

fetchAccountBalances.test.js

  • Verifies that given a valid publicKey, the function returns an array of balances.

fetchRecentPayments.test.js

  • Verifies that the function returns an array of recent payments for a valid account.

fundWithFriendbot.test.js

  • Verifies that the function correctly calls the friendbot service on the testnet to fund the account.

startTransaction.test.js

  • Verifies that a transaction is correctly initialized.

submit.test.js

  • Verifies that a transaction is successfully submitted.

findStrictSendPaths.test.js

  • Verifies that the function returns valid payment paths.

findStrictReceivePaths.test.js

  • Verifies that the function returns valid payment paths.

Al tests passed successfully:

Screenshot 2024-10-07 at 9 20 58 PM

@jimenezz22 jimenezz22 marked this pull request as ready for review October 7, 2024 07:13
Copy link
Contributor

@ElliotFriend ElliotFriend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, there @jimenezz22!

This looks pretty great! As I've mentioned I'm not too familiar with setting up unit tests, but it looks like the tests you've written are looking at the right things for the horizon queries.

Looks like you're still planning to work on the other files, but let me know if there's anything else you need. Thanks!

Edit: We've also merged in #23, which updates a lot of package versions, so you'll need to bring in those changes to your branch so there aren't any conflicts.

Copy link
Contributor

@ElliotFriend ElliotFriend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, there! Thanks for the work on this! Looks like there are a couple regressions from the previously updated packages to take care of, and some changes to incorporate the newer usage patterns of @stellar/stellar-sdk.

Let me know if you have any questions about the comments I left. Thanks!

@jimenezz22
Copy link
Contributor Author

@ElliotFriend I will review the comments and make the requested changes 🫡

@jimenezz22
Copy link
Contributor Author

@ElliotFriend All changes for versions applied, some tests doesn't works after the version change, I will focus on solving this 🫡

@jimenezz22
Copy link
Contributor Author

gm @ElliotFriend
All unit tests pass according to previously requested version changes
Screenshot 2024-10-27 at 8 43 05 PM

Copy link
Contributor

@ElliotFriend ElliotFriend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @jimenezz22! Thanks again for the work on these tests!

One small JSDoc change, I've requested. Other than that, everything is looking good! Excited to get this merged!

Copy link
Contributor

@ElliotFriend ElliotFriend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks for all the hard work!

@ElliotFriend ElliotFriend merged commit 1528826 into stellar:main Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests

2 participants