import { FunctionComponent, PropsWithChildren, ReactElement } from "react"; import { useForm } from "@mantine/form"; import { describe, it } from "vitest"; import { FormContext, FormValues } from "@/pages/Settings/utilities/FormValues"; import { render, screen } from "@/tests"; import { Number, Text } from "./forms"; const FormSupport: FunctionComponent = ({ children }) => { const form = useForm({ initialValues: { settings: {}, hooks: {}, }, }); return {children}; }; const formRender = (ui: ReactElement) => render({ui}); describe("Settings form", () => { describe("number component", () => { it("should be able to render", () => { formRender(); expect(screen.getByRole("textbox")).toBeDefined(); }); }); describe("text component", () => { it("should be able to render", () => { formRender(); expect(screen.getByRole("textbox")).toBeDefined(); }); }); });