Hi am new to jest test cases on reactcan someone Guide me approach to write Unit Test Case for geolocation on React UseEffet method and Thanks in Advance !
useEffect(() => { const getMyLocation = () => { const location = window.navigator && window.navigator.geolocation; if (location) { location.getCurrentPosition((position) => { setIsAcceptedGeoLocation(true); setCurrentLatLng({ latitude: position.coords.latitude, longitude: position.coords.longitude, }); }, (error) => { setIsAcceptedGeoLocation(false); console.error('error', error); }); } }; getMyLocation(); }, []);