Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Checkbox test
import React from "react"
import Checkbox from "./Checkbox"
import { render, fireEvent, cleanup } from "react-testing-library"
afterEach(cleanup)
it("testa check", () => {
const { getByTestId } = render(<Checkbox />)
fireEvent.click(getByTestId("meucheck"))
expect(getByTestId("meucheck").value).toEqual("123");
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment