{"size": 804, "ext": "js", "max_stars_repo_path": "frontend/src/components/EventForm/__tests__/EventForm.test.js", "max_stars_repo_name": "filippietruszynski/add-an-event", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "frontend/src/components/EventForm/__tests__/EventForm.test.js", "max_issues_repo_name": "filippietruszynski/add-an-event", "max_issues_repo_issues_event_min_datetime": "2021-08-02T02:33:52.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-02T02:34:01.000Z", "max_forks_repo_path": "frontend/src/components/EventForm/__tests__/EventForm.test.js", "max_forks_repo_name": "filippietruszynski/recruitment-task", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 30.9230769231, "max_line_length": 64, "alphanum_fraction": 0.6206467662}
import { render } from "@testing-library/react";
import "@testing-library/jest-dom/extend-expect";

import EventForm from "../EventForm";

describe("EventForm", () => {
  describe("Initial render", () => {
    test("Renders itself", () => {
      render(<EventForm />);
    });

    test("Renders labels", () => {
      const { getByLabelText } = render(<EventForm />);
      expect(getByLabelText(/first name/i)).toBeInTheDocument();
      expect(getByLabelText(/last name/i)).toBeInTheDocument();
      expect(getByLabelText(/email/i)).toBeInTheDocument();
      expect(getByLabelText(/event date/i)).toBeInTheDocument();
    });

    test("Renders button text", () => {
      const { getByText } = render(<EventForm />);
      expect(getByText(/add an event/i)).toBeInTheDocument();
    });
  });
});
