Creating tests for React components
As developers, we don't want complex development experiences where we get slowed down or, even worse, the entire team gets slowed down by complex architectures and libraries that make software unmaintainable. The React Testing Library is a lightweight solution for testing React components. It provides utility functions on top of react-dom
to query the DOM in the same way the user would.
Understanding this as we did in the previous section, I'm going to explain the principal methods we're going to use, but I encourage you to have a read of the Testing Library website:
import { render, screen } from "@testing-library/react" describe("described suite", () => {   it("should render correctly", () => {     render(<SomeComponent />)     expect(screen.queryByText("some text in the screen")).    toBeInTheDocument(...