i'm using react-testing-library & jest in my project.
My question is: Can i isolate my child component from test when i test my parent component?
here is my component:
export const Parent: FC = ({items}) => {
return (
<>
<ListComponent items={items} />
<ChildWillBeIsolated />
</>
)
}
and it's my test:
import React from "react";
import { Parent as Component } from "./";
import { render } from "@testing-library/react";
const items = [
{
title: "A"
id: 1
},
{
title: "B"
id: 2
}
]
it("renders without crashing", async () => {
const wrapper = render(
<Component items={items} />
);
expect(wrapper).toMatchSnapshot();
wrapper.unmount();
});
so here i wan't to isolate my ChildWillBeIsolated component from test. how i can do that?