Problem and Solutions
React testing with Jest and Enzyme: How to write test for connected components with API call and props in react.js ?
By M.K. Verma · 2 May 2022

test("renders singleitem with data", async () => {
const mockupData = {
name: "Homer Simpson",
job: "Nuclear Safety Inspector",
id: "14",
};
render(
<SingleItem data={mockupData} />
);
const element = await screen.findByText(/Homer Simpson/i);
expect(element).toBeInTheDocument();
});