// import { fireEvent, render, waitFor } from "@testing-library/react";

// import { createForm } from "factory";

describe("createForm [ Base ]", () => {
  // type SighUpForm = {
  //   user: {
  //     email: string;
  //     password: string;
  //     confirmPassword: string;
  //   };
  // };

  // let formInstance = createForm<SighUpForm>({
  //   user: {
  //     email: "",
  //     password: "",
  //     confirmPassword: "",
  //   },
  // });

  beforeEach(() => {
    // formInstance = createForm<SighUpForm>({
    //   user: {
    //     email: "",
    //     password: "",
    //     confirmPassword: "",
    //   },
    // });
  });

  // describe("when creating functional form", () => {
  //   it("should allow to render fields and submit values", async () => {
  //     const { Form, FormButton } = formInstance;
  //     const onSubmit = jest.fn();

  //     const App = () => {
  //       return (
  //         <Form onSubmit={onSubmit}>
  //           {/* <Field data-testid="user.email" name="user.email" type="text" />
  //           <Field data-testid="user.password" name="user.password" type="text" />
  //           <Field data-testid="user.confirmPassword" name="user.confirmPassword" type="text" /> */}
  //           <FormButton data-testid="submit" type="submit">
  //             Submit
  //           </FormButton>
  //         </Form>
  //       );
  //     };

  //     const { getByTestId } = render(<App />);

  //     const emailInput = getByTestId("user.email");
  //     const passwordInput = getByTestId("user.password");
  //     const confirmPasswordInput = getByTestId("user.confirmPassword");
  //     const submitButton = getByTestId("submit");

  //     fireEvent.change(emailInput, { target: { value: "" } });
  //     fireEvent.change(passwordInput, { target: { value: "" } });
  //     fireEvent.change(confirmPasswordInput, { target: { value: "" } });
  //     fireEvent.click(submitButton);

  //     await waitFor(() => {
  //       expect(onSubmit).toHaveBeenCalledTimes(1);
  //       expect(onSubmit).toHaveBeenCalledWith({
  //         user: {
  //           email: "",
  //           password: "",
  //           confirmPassword: "",
  //         },
  //       });
  //     });
  //   });
  // });
});
