Tsallaka zuwa abun ciki
Justice Tech School

Testing Components

Render a component and assert on what the user sees.

Example
import { render, screen } from "@testing-library/react";
test("shows name", () => {
  render(<p>Ada</p>);
  expect(screen.getByText("Ada")).toBeTruthy();
});

Exercise

Render in a test.

(<App />);

Quiz Test

What should tests look at?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.