I'm new to unit testing and having trouble testing whether a Material-UI withStyles component with required propTypes is rendering children Material-UI elements.
profile.js
const StaticProfile = (props) => {
const { classes, profile } = props
}
return (
<Paper>
<div>
<MuiLink></MuiLink>
<Typography>
<LocationOn>
<LinkIcon>
<Calendar>
</div>
</Paper>
)
profile.test.js
describe('<StaticProfile />', () => {
let shallow;
let wrapper;
const myProps = {
profile: {},
classes: {}
}
beforeEach(() => {
shallow = createShallow();
wrapper = shallow(<StaticProfile {...myProps} />);
})
it('should render a Paper element', () => {
expect(wrapper.find(Paper).length).toBe(1);
})
})
However, it doesn't seem like the component is rendered at all with this error received.
expect(received).toBe(expected) // Object.is equality
Expected: 1
Received: 0
Could someone please point me in the right direction?