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
Only show SendTransaction on your accounts #865
Conversation
MegaLinter status: ✅ SUCCESS
See errors details in artifact MegaLinter reports on CI Job page |
Codecov Report
@@ Coverage Diff @@
## master #865 +/- ##
==========================================
- Coverage 88.05% 88.02% -0.03%
==========================================
Files 96 96
Lines 1599 1604 +5
Branches 334 336 +2
==========================================
+ Hits 1408 1412 +4
- Misses 191 192 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
||
export function SendTransaction(props: SendTransactionProps) { | ||
if (!props.isAddressInWallet) { | ||
throw new Error('SendTransaction component should only appear on your accounts') |
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.
I get idea that entire app will blow up to catch an error, but I think it's better to cover such scenarios in unit tests than in a component via new Error.
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.
I don't think tests can ensure that we devs don't move SendTransaction outside the condition:
{isAddressInWallet && (
...
<SendTransaction
Maybe with integration tests of all possible user flows 🤷
Before:
oasis1qqug..hsu8
to walletoasis1qr9t..gxfl
oasis1qqug..hsu8
to any Recipient