`
it('Should render ComB when parameter value=A', () => {
const {container} = render(<ComB/>);
expect(container).toBeInTheDocument()
});
`I want write a jest test case for following code as it show branch coverage 50% and point out for this code.
export default function TestCom(){
const parameter=useParams();
return(
<>
{
parameter.value==="A" ?
(<ComB/>) :
(parameter.value==="B" && <ComC/>)
}
</>
)
}
I am fetching query parameter value and based upon the parameter value conditionally rendering the "components". So can anyone please help how can I write jest test cases for this ternary operator.