-
Notifications
You must be signed in to change notification settings - Fork 985
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
Wallet: Utility Tests #18371
Wallet: Utility Tests #18371
Conversation
Jenkins BuildsClick to see older builds (49)
|
networks [{:chain-id :chain-1 :name "Network A"} | ||
{:chain-id :chain-3 :name "Network C"}]] | ||
(is (= (utils/network-list {:balances-per-chain balances-per-chain} networks) | ||
#{:chain-1 :chain-3}))))) |
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.
just curious is :chain-1
etc abitrary? this is normally the chain id? e.g :1
?
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.
@J-Son89 yes the chain id like :1
. I think the values used in tests don't matter much as long as the test returns the correct value, but I can update it to :1
👍
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.
actually we are transforming (or we should) to 1
instead.
it is important to keep the type because a function could break if we don't provide the proper one (such as the common exception name not supported
).
f85630d
to
fad78ca
Compare
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.
Thanks for this PR @OmarBasem !
Some of our utility functions are being used by our subscriptions, and our subs have tests, so just let's be careful about it, we don't need to double test a function, we could instead improve the existing one, although adding extra tests isn't bad.
[balances-per-chain] | ||
(println "calling totalxxx", balances-per-chain) |
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.
Leftover
Thanks for notifying me about this. Having tests for individual utility functions is still good to have as they may be used for other functions/subs |
b7e0d6a
to
1b965f6
Compare
0bed5ed
to
68cd4e7
Compare
fixes: #18370
This PR adds tests for all utility functions under
status-im.contexts.wallet.common.utils