I want to test below snippet in jest .Anyone can help me to do this `
const controlNavbar = useCallback(() => {
if (typeof window !== 'undefined') {
if (window.scrollY > lastScrollY) {
setScrollUp(false)
}
if (window.scrollY < lastScrollY) {
setScrollUp(true)
}
setLastScrollY(window.scrollY)
}
}, [lastScrollY])
`
I want to pass test coverage but it shows that I didn't cover this piece of code