Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Unit Test Case for Navigation #973

Open
carmelrajtradu opened this issue Jun 28, 2024 · 0 comments
Open

React Unit Test Case for Navigation #973

carmelrajtradu opened this issue Jun 28, 2024 · 0 comments
Labels
question Further information is requested

Comments

@carmelrajtradu
Copy link

I need some ones help to write a unit test for this code. I have write a test case but its not working. I can't copy and past original so I have created dummy code and pasted it.

import {useState, useEffect} from 'React';
import {useNavigate} from 'react-router-dom';
import {useSelector} from 'react-redux';
const componentName=()=>{
const navigate = useNavigate();
const {loginRes} = useSelector((state).signUp)
const [data, setData] = useState()

useEffect(()=>{
	if(loginRes.autoRejection){
		navigate('/rejection')
	}else{
		navigate('/docUpload')
	}
},[loginRes])

}
export default componentName;

@carmelrajtradu carmelrajtradu added the question Further information is requested label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant