fix: UX - Error logs in development from Empty state component#466
Merged
bryphe-coder merged 4 commits intomainfrom Mar 17, 2022
Merged
fix: UX - Error logs in development from Empty state component#466bryphe-coder merged 4 commits intomainfrom
bryphe-coder merged 4 commits intomainfrom
Conversation
presleyp
reviewed
Mar 16, 2022
| @@ -0,0 +1,22 @@ | |||
| // Helper utility to fail jest tests if a console.error is logged | |||
| // Pulled from this blog post: | |||
| // https://www.benmvp.com/blog/catch-warnings-jest-tests/ | |||
Codecov Report
@@ Coverage Diff @@
## main #466 +/- ##
==========================================
- Coverage 68.20% 68.17% -0.04%
==========================================
Files 160 160
Lines 9260 9259 -1
Branches 79 79
==========================================
- Hits 6316 6312 -4
- Misses 2326 2329 +3
Partials 618 618
Continue to review full report at Codecov.
|
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.
Fixes #452
When the empty state is rendered with a non-textual element (which it turns out all our current empty states are, because they have a
<button />component as a call to action), this noisy error log was showing up in theconsole:The issue was that the
descriptionprop could either be astringor an actualReactcomponent, but was always rendered as a child of a<Typography />component. The<Typography>component internally renders as a<p>, which is not valid to nest<div>s inside.The fix is to not nest inside a
<Typography />block, but an actual<div />.