Skip to content

Instantly share code, notes, and snippets.

@ivanbtrujillo
Created June 6, 2019 17:31
Show Gist options
  • Save ivanbtrujillo/6145c8c5b17e210854846183c673b3e7 to your computer and use it in GitHub Desktop.
Save ivanbtrujillo/6145c8c5b17e210854846183c673b3e7 to your computer and use it in GitHub Desktop.
react-testing-library-article-4
import React from "react";
import { render, cleanup, fireEvent } from "@testing-library/react";
import Sum from "./Sum";
describe("Sum", () => {
it('should have two inputs to add the numbers', () => {
const { getByTestId } = render(<Sum />);
const firstInput = getByTestId("value1");
const secondInput = getByTestId("value2");
expect(firstInput).toBeTruthy();
expect(secondInput).toBeTruthy();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment