Skip to content

React Unit Test Case for Navigation #973

Description

@carmelrajtradu

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;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions