Skip to content
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

Merged
merged 10 commits into from
Nov 16, 2019
Merged

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Nov 15, 2019

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.

@eps1lon eps1lon added the test label Nov 15, 2019
@@ -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) {
Copy link
Member Author

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) {
Copy link
Member Author

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.');
Copy link
Member Author

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) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never hit: https://codecov.io/gh/mui-org/material-ui/src/master/packages/material-ui/src/MenuList/MenuList.js#L38

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.

@mui-pr-bot
Copy link

Details of bundle changes.

Comparing: 4ce0f41...177dc61

bundle Size Change Size Gzip Change Gzip
@material-ui/core ▲ +48 B (+0.01% ) 351 kB ▲ +30 B (+0.03% ) 95.9 kB
docs.main ▲ +24 B (0.00% ) 606 kB ▲ +26 B (+0.01% ) 193 kB
@material-ui/lab ▲ +12 B (+0.01% ) 171 kB ▼ -1 B (-0.00% ) 51.6 kB
MenuList ▼ -8 B (-0.01% ) 64.5 kB ▼ -5 B (-0.02% ) 20.1 kB
Select ▲ +6 B (+0.01% ) 113 kB ▲ +6 B (+0.02% ) 33.4 kB
Tabs ▲ +6 B (+0.01% ) 83.9 kB ▼ -5 B (-0.02% ) 26.7 kB
ButtonGroup ▲ +6 B (+0.01% ) 80.5 kB ▲ +4 B (+0.02% ) 24.7 kB
TablePagination ▲ +6 B (0.00% ) 139 kB ▲ +4 B (+0.01% ) 40.6 kB
ExpansionPanel ▲ +6 B (+0.01% ) 69.8 kB ▲ +3 B (+0.01% ) 21.7 kB
Step ▲ +6 B (+0.01% ) 61.2 kB ▼ -2 B (-0.01% ) 19.2 kB
TextField ▲ +6 B (0.00% ) 121 kB ▲ +2 B (+0.01% ) 35.5 kB
ToggleButtonGroup ▲ +6 B (+0.01% ) 61.7 kB ▼ -2 B (-0.01% ) 19.4 kB
Breadcrumbs ▲ +6 B (+0.01% ) 66.5 kB ▼ -1 B (-0.00% ) 20.9 kB
GridList ▲ +6 B (+0.01% ) 61 kB ▼ -1 B (-0.01% ) 19.1 kB
SpeedDial ▲ +6 B (+0.01% ) 84.5 kB ▼ -1 B (-0.00% ) 26.6 kB
BottomNavigation ▲ +6 B (+0.01% ) 60.9 kB -- 19.1 kB
Menu ▼ -2 B (-0.00% ) 86.7 kB ▲ +4 B (+0.01% ) 27.2 kB
@material-ui/core[umd] ▼ -1 B (-0.00% ) 310 kB ▼ -1 B (-0.00% ) 89.2 kB
Radio -- 81.1 kB ▼ -11 B (-0.04% ) 25.5 kB
Checkbox -- 80.3 kB ▼ -10 B (-0.04% ) 25.2 kB
StepButton -- 80.8 kB ▼ -10 B (-0.04% ) 25.3 kB
ExpansionPanelSummary -- 76.6 kB ▼ -9 B (-0.04% ) 24.1 kB
OutlinedInput -- 72.6 kB ▼ -9 B (-0.04% ) 22.5 kB
Tooltip -- 99 kB ▼ -9 B (-0.03% ) 31.3 kB
Rating -- 68.5 kB ▼ -8 B (-0.04% ) 21.9 kB
Autocomplete -- 126 kB ▼ -7 B (-0.02% ) 39.8 kB
Backdrop -- 66.3 kB ▼ -7 B (-0.03% ) 20.4 kB
CardActionArea -- 73.5 kB ▼ -7 B (-0.03% ) 23.2 kB
NativeSelect -- 75.3 kB ▼ -7 B (-0.03% ) 23.7 kB
Slider -- 74.1 kB ▼ -7 B (-0.03% ) 23.4 kB
SpeedDialAction -- 115 kB ▼ -7 B (-0.02% ) 36.4 kB
TableSortLabel -- 75.8 kB ▼ -7 B (-0.03% ) 24 kB
TreeItem -- 72.1 kB ▼ -7 B (-0.03% ) 22.7 kB
Button -- 77.9 kB ▼ -6 B (-0.03% ) 23.8 kB
Chip -- 81 kB ▼ -6 B (-0.02% ) 24.7 kB
Collapse -- 66.4 kB ▼ -6 B (-0.03% ) 20.5 kB
Dialog -- 81.1 kB ▼ -6 B (-0.02% ) 25.1 kB
Drawer -- 82.8 kB ▼ -6 B (-0.02% ) 25.6 kB
Grid -- 63.6 kB ▼ -6 B (-0.03% ) 19.9 kB
GridListTile -- 62.3 kB ▼ -6 B (-0.03% ) 19.5 kB
IconButton -- 74.6 kB ▼ -6 B (-0.03% ) 23.2 kB
InputBase -- 69.1 kB ▼ -6 B (-0.03% ) 21.6 kB
LinearProgress -- 63.9 kB ▼ -6 B (-0.03% ) 19.9 kB
Link -- 65.1 kB ▼ -6 B (-0.03% ) 20.6 kB
RadioGroup -- 61.8 kB ▼ -6 B (-0.03% ) 19.3 kB
Skeleton -- 61 kB ▼ -6 B (-0.03% ) 19.2 kB
Tab -- 74.8 kB ▼ -6 B (-0.03% ) 23.7 kB
ToggleButton -- 74.6 kB ▼ -6 B (-0.03% ) 23.5 kB
TreeView -- 64.9 kB ▼ -6 B (-0.03% ) 20.3 kB
Badge -- 63.9 kB ▼ -5 B (-0.03% ) 19.8 kB
CardContent -- 60.5 kB ▼ -5 B (-0.03% ) 18.9 kB
CardHeader -- 63.6 kB ▼ -5 B (-0.02% ) 20 kB
CardMedia -- 60.9 kB ▼ -5 B (-0.03% ) 19.1 kB
CircularProgress -- 62.6 kB ▼ -5 B (-0.03% ) 19.7 kB
Container -- 61.7 kB ▼ -5 B (-0.03% ) 19.2 kB
ExpansionPanelActions -- 60.6 kB ▼ -5 B (-0.03% ) 19 kB
Fab -- 75.3 kB ▼ -5 B (-0.02% ) 23.4 kB
FilledInput -- 72.1 kB ▼ -5 B (-0.02% ) 22.3 kB
FormGroup -- 60.5 kB ▼ -5 B (-0.03% ) 18.9 kB
GridListTileBar -- 61.8 kB ▼ -5 B (-0.03% ) 19.3 kB
Hidden -- 64.5 kB ▼ -5 B (-0.02% ) 20.2 kB
Icon -- 61.3 kB ▼ -5 B (-0.03% ) 19.2 kB
Input -- 71 kB ▼ -5 B (-0.02% ) 22.1 kB
InputLabel -- 63.9 kB ▼ -5 B (-0.03% ) 19.9 kB
ListItemIcon -- 60.7 kB ▼ -5 B (-0.03% ) 19 kB
ListItemSecondaryAction -- 60.5 kB ▼ -5 B (-0.03% ) 18.9 kB
ListItemText -- 63.5 kB ▼ -5 B (-0.03% ) 20 kB
ListSubheader -- 61.3 kB ▼ -5 B (-0.03% ) 19.2 kB
MobileStepper -- 66.3 kB ▼ -5 B (-0.02% ) 20.6 kB
SpeedDialIcon -- 63.1 kB ▼ -5 B (-0.03% ) 19.8 kB
StepLabel -- 67.1 kB ▼ -5 B (-0.02% ) 21 kB
Stepper -- 63.3 kB ▼ -5 B (-0.03% ) 19.9 kB
SvgIcon -- 61.6 kB ▼ -5 B (-0.03% ) 19.2 kB
Switch -- 79.6 kB ▼ -5 B (-0.02% ) 24.7 kB
Table -- 61.1 kB ▼ -5 B (-0.03% ) 19.1 kB
TableBody -- 60.6 kB ▼ -5 B (-0.03% ) 18.9 kB
TableHead -- 60.6 kB ▼ -5 B (-0.03% ) 18.9 kB
TableRow -- 61.1 kB ▼ -5 B (-0.03% ) 19.1 kB
Toolbar -- 60.9 kB ▼ -5 B (-0.03% ) 19.1 kB
Typography -- 62.2 kB ▼ -5 B (-0.03% ) 19.4 kB
AppBar -- 62.3 kB ▼ -4 B (-0.02% ) 19.5 kB
Avatar -- 61.3 kB ▼ -4 B (-0.02% ) 19.3 kB
BottomNavigationAction -- 74 kB ▼ -4 B (-0.02% ) 23.4 kB
Card -- 61.3 kB ▼ -4 B (-0.02% ) 19.2 kB
CardActions -- 60.6 kB ▼ -4 B (-0.02% ) 19 kB
DialogActions -- 60.6 kB ▼ -4 B (-0.02% ) 19 kB
DialogContent -- 60.8 kB ▼ -4 B (-0.02% ) 19 kB
DialogContentText -- 62.6 kB ▼ -4 B (-0.02% ) 19.6 kB
Divider -- 61.1 kB ▼ -4 B (-0.02% ) 19.2 kB
ExpansionPanelDetails -- 60.5 kB ▼ -4 B (-0.02% ) 18.9 kB
FormControl -- 62.9 kB ▼ -4 B (-0.02% ) 19.5 kB
FormControlLabel -- 64 kB ▼ -4 B (-0.02% ) 20.1 kB
FormHelperText -- 61.8 kB ▼ -4 B (-0.02% ) 19.3 kB
InputAdornment -- 63.6 kB ▼ -4 B (-0.02% ) 20 kB
ListItemAvatar -- 60.6 kB ▼ -4 B (-0.02% ) 19 kB
SnackbarContent -- 64.2 kB ▼ -4 B (-0.02% ) 20.2 kB
StepConnector -- 61.3 kB ▼ -4 B (-0.02% ) 19.2 kB
StepContent -- 67.5 kB ▼ -4 B (-0.02% ) 21 kB
StepIcon -- 63.2 kB ▼ -4 B (-0.02% ) 19.6 kB
SwipeableDrawer -- 90.2 kB ▼ -4 B (-0.01% ) 28 kB
TableFooter -- 60.6 kB ▼ -4 B (-0.02% ) 19 kB
@material-ui/styles -- 50.8 kB ▼ -3 B (-0.02% ) 15.4 kB
@material-ui/system -- 14.8 kB ▼ -3 B (-0.07% ) 4.06 kB
DialogTitle -- 62.8 kB ▼ -3 B (-0.02% ) 19.7 kB
FormLabel -- 62 kB ▼ -3 B (-0.02% ) 19.2 kB
List -- 60.9 kB ▼ -3 B (-0.02% ) 18.9 kB
Modal -- 14.2 kB ▼ -3 B (-0.06% ) 4.96 kB
NoSsr -- 2.19 kB ▼ -3 B (-0.29% ) 1.03 kB
Paper -- 60.8 kB ▼ -3 B (-0.02% ) 18.9 kB
Slide -- 24.2 kB ▼ -3 B (-0.04% ) 8.24 kB
Snackbar -- 75.7 kB ▼ -3 B (-0.01% ) 23.6 kB
useAutocomplete -- 12.1 kB ▼ -3 B (-0.07% ) 4.47 kB
Zoom -- 22.2 kB ▼ -3 B (-0.04% ) 7.63 kB
Box -- 69.3 kB ▼ -2 B (-0.01% ) 21 kB
ButtonBase -- 72.5 kB ▼ -2 B (-0.01% ) 22.7 kB
ClickAwayListener -- 3.87 kB ▼ -2 B (-0.13% ) 1.56 kB
CssBaseline -- 56.1 kB ▲ +2 B (+0.01% ) 17.5 kB
Popover -- 81.1 kB ▼ -2 B (-0.01% ) 25 kB
Popper -- 28.5 kB ▼ -2 B (-0.02% ) 10.2 kB
Portal -- 2.87 kB ▼ -2 B (-0.15% ) 1.29 kB
TableCell -- 62.6 kB ▼ -2 B (-0.01% ) 19.6 kB
Fade -- 22.1 kB ▼ -1 B (-0.01% ) 7.63 kB
ListItem -- 75.6 kB ▼ -1 B (-0.00% ) 23.6 kB
MenuItem -- 76.6 kB ▼ -1 B (-0.00% ) 23.9 kB
RootRef -- 4.43 kB ▲ +1 B (+0.06% ) 1.67 kB
TextareaAutosize -- 5.06 kB ▼ -1 B (-0.05% ) 2.11 kB
useMediaQuery -- 2.49 kB ▲ +1 B (+0.10% ) 1.05 kB
colorManipulator -- 3.83 kB -- 1.52 kB
docs.landing -- 55.8 kB -- 14.3 kB
Grow -- 22.7 kB -- 7.76 kB
styles/createMuiTheme -- 15.3 kB -- 5.4 kB

Generated by 🚫 dangerJS against 177dc61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants