import { render, screen } from "@testing-library/react";
import Contact from "./index";
import { Provider } from "react-redux";
import { store } from "../../state/store";
test("renders contact form and details", () => {
  render(
    <Provider store={store}>
      <Contact />
    </Provider>
  );
  const formElement = screen.getByRole("form");
  expect(formElement).toBeInTheDocument();

  const detailsElement = screen.getByRole("contact-details");
  expect(detailsElement).toBeInTheDocument();
});
const Contact: React.FC<RefProps> = ({ contactref }) => {
  const stateForm = useAppSelector((state) => state.formModal.isOpen);
  return (
    <section className="contact" ref={contactref}>
      <Form />
      <ContactDetails />
      {stateForm && <ModalForm />}
    </section>
  );
};
export default Contact;
correct above component to get with test