score:4

Accepted answer

The solution is very simple, when testing the LoginForm you are not passing the props that the Snackbar requires. Pass them as

 const component = renderer.create(
        <MuiThemeProvider>
            <LoginForm snackOpen={true}
    snackMessage={'Wrong info'}/>
        </MuiThemeProvider>
    )

score:1

In a component the required props if we misspelled then we will get this error, In my case I had same problem

Error: <Dialog in={props.open}>

            <Dialog in={props.open}>
                <Alert
                    action={
                        <IconButton
                            aria-label='close'
                            color='inherit'
                            size='small'
                            onClick={useCallback(() => props.closeAlert({ msg: '', open: false }))}
                        >
                            <CloseIcon fontSize='inherit' />
                        </IconButton>
                    }
                >
                    {props.msg}
                </Alert>
            </Dialog>

Solution: <Dialog open={props.open}>

        <Dialog open={props.open}>
                <Alert
                    action={
                        <IconButton
                            aria-label='close'
                            color='inherit'
                            size='small'
                            onClick={useCallback(() => props.closeAlert({ msg: '', open: false }))}
                        >
                            <CloseIcon fontSize='inherit' />
                        </IconButton>
                    }
                >
                    {props.msg}
                </Alert>
            </Dialog>

Related Query

More Query from same tag