Jest provides a handful of functions that can be used to test React components. The list can be found at https://jestjs.io/docs/en/snapshot-testing.
Testing React components
React components and mocking components
Let's consider a React component, as shown in the following code and in the file Header.js:
import React from "react";
import Link from "react-router-dom/Link";
const Header = () => (
<ul>
<li>
<Link to="/">Home</Link>
</li>
<li>
<Link to="/about">Services</Link>
</li>
<li>
<Link to="/topics">Contact Us</Link>
</li>
<li>
<Link to="/topics...