import { Nullable } from "@reins/types"; import { render } from "@testing-library/react"; import { createForm } from "factory"; type InitialValues = { name: string | null; surname: string | null; age: number | null; address: Nullable<{ street: string; city: string; country: string; }>; }; const initialValues: InitialValues = { name: null, surname: null, age: null, address: null, }; describe("useField [ Base ]", () => { const onSubmit = jest.fn(); let form = createForm(initialValues); beforeEach(() => { form = createForm(initialValues); onSubmit.mockClear(); }); const Field1 = () => { const { field } = form.useField("name"); return