-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[test] Improve coverage #18385
[test] Improve coverage #18385
Conversation
Consistent with other error messages and markdown
@@ -280,7 +281,7 @@ const SpeedDial = React.forwardRef(function SpeedDial(props, ref) { | |||
|
|||
const allItems = React.Children.toArray(childrenProp).filter(child => { | |||
if (process.env.NODE_ENV !== 'production') { | |||
if (child.type === React.Fragment) { |
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.
Less usage of react internals
// eslint-disable-next-line react-hooks/rules-of-hooks | ||
const theme = useTheme(); | ||
if (!theme.shadows[elevation]) { | ||
if (classes[`elevation${elevation}`] === undefined) { |
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.
We could technically move this into propTypes but I wanted to avoid adding hurdles when migrating from withStyles to makeStyles.
Nice side-effect is that styles creation and this warning are now decoupled. Previously refactoring of how we would create the elevation classes would require refactoring this check.
} | ||
|
||
if (typeof htmlFontSize !== 'number') { | ||
console.error(`Material-UI: 'htmlFontSize' is required to be a number.`); | ||
console.error('Material-UI: `htmlFontSize` is required to be a number.'); |
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.
Backticks mimic how we display inline code in markdown.
@@ -35,9 +36,6 @@ function textCriteriaMatches(nextFocus, textCriteria) { | |||
// jsdom doesn't support innerText | |||
text = nextFocus.textContent; | |||
} | |||
if (text === undefined) { |
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.
Could not find info why this would be undefined
. It can be null
apparently but I wouldn't know when and so far we never encountered this.
Details of bundle changes.Comparing: 4ce0f41...177dc61
|
Mostly dev-only warnings that weren't tested. It helps to test those to get a better picture of the warning that will be displayed.