Skip to content

Instantly share code, notes, and snippets.

@marlosirapuan
Created July 31, 2019 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marlosirapuan/8aeb1e2a9a163b952364516518e5df58 to your computer and use it in GitHub Desktop.
Save marlosirapuan/8aeb1e2a9a163b952364516518e5df58 to your computer and use it in GitHub Desktop.
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