import { fireEvent, render } from "@testing-library/react";
import React from "react";
import Modal from "../modal";

describe("Modal", () => {
  test("When the modal is not shown", () => {
    const { getByLabelText } = render(
      <Modal 
        handleClose={() => {}} 
        show={false}
      >
        {" "}
      </Modal>
    );

    expect(getByLabelText("modal--hidden")).toHaveClass("react-modal--hidden");
  });

  test("When the modal is shown", () => {
    const { getByLabelText } = render(
      <Modal 
        handleClose={() => {}} 
        show={true}
      >
        {" "}
      </Modal>
    );

    expect(getByLabelText("modal--shown")).toHaveClass("react-modal");
  });

  test("Calls close handler when clicked", () => {
    const handleClick = jest.fn();

    const { getByLabelText } = render(
      <Modal 
        handleClose={handleClick} 
        show={true}
      >
        {" "}
      </Modal>
    );

    fireEvent.click(getByLabelText(/close/));

    expect(handleClick).toHaveBeenCalledTimes(1);
  });
});

@@ -137,33 +137,77 @@
 () =%3E %7B%0A  test(%22
-W
+Checks for the specified classname on modal w
 hen the modal is
@@ -477,9 +477,53 @@
 st(%22
-W
+Checks for the specified classname on modal w
 hen 

Add descriptive test names