I am running a test on jest and it says that some certain code lines are not covered. In my case it is the line where Resizable component is defined. This component comes from npm package called "re-resizable"
class SomeComponent extends Component {
constructor(props) {
super(props)
this.state({
height: 0
})
}
render() {
return (
<div>
<Resizable
onResizeStop={(e, direction, ref, d) => {
this.setState({
height: this.state.height + d.height
})
)}
/>
</div>
)
}
}
So seems like I have to test the onResizeStop props which provides a function to the Resizable component. How can I trigger the onResizeStop event and assert that height state was changed? I am using enzyme version 3.10.0 and jest version 26.5.3