I have multiple useState in react component. Some states are set from event handler of component. How to mock such instance of state using jest and react-testing-library ?
Example:
function Component () {
const [isEnabled, setIsEnabled] = useState(false)
const [isClick, setIsClick] = useState(false)
const [isData, setIsData] = useState(false)
const handleData = () => {
setIsClick(true)
}
return(
<div>
//form component
<button onSubmit={handleData}>Submit</>
</div>
)
}