// 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({ // user: { // email: "", // password: "", // confirmPassword: "", // }, // }); beforeEach(() => { // formInstance = createForm({ // 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 ( //
// {/* // // */} // // Submit // // // ); // }; // const { getByTestId } = render(); // 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: "", // }, // }); // }); // }); // }); });