I have header component like below:
import { useLocation } from \"react-router-dom\"; const Header = () => { let route = useLocation().pathname; retur
Have you tried:
describe("", () => { it("call the header component", () => { const wrapper = shallow(); expect(wrapper.find(Header).dive().find(ComponentA)).toHaveLength(1); }); });
When you use shallow only the first lvl is rendered, so you need to use dive to render another component.