-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create test for useWallet #180
Conversation
Add @testing-library/react-hooks, make use of Provider for context and test that useWallet can instantiate and trigger the request to connect to the correct network.
|
Improve readability of the tests and their output
The chromatic run failed because this PR is made from a fork. If you want to, then you could re open the PR from a branch in the repo. that said, since it's only a test, i feel like it would be safe without chromatic running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few comments but mostly good. thanks for adding tests!
Addresses feedback on the PR. Also adddresses (in comment) the fact that we are not handling high number networks in hex, which is what comments in the code of useWallet call for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's do it, thanks for the tests!
@allcontributors add @gjsyme for code |
I've put up a pull request to add @gjsyme! 🎉 |
Closes #176
Description
Add @testing-library/react-hooks, make use of Provider for context and test that useWallet can instantiate and trigger the request to connect to the correct network.
📝 Additional Information
Pretty basic tests, but extensible if we want to either deeply mock window.ethereum, make use of another external library (though none jump out as best-choice), or solve this in another way.