UNPKG

@tsed/schema-formio

Version:

Transform Ts.ED Schema & JsonSchema to a valid Formio schema

36 lines (33 loc) 764 B
import {getFormioSchema} from "../utils/getFormioSchema.js"; import {Prefix} from "./prefix.js"; describe("@Prefix", () => { it("should add a prefix on field", async () => { class Model { @Prefix("The prefix") test: string; } expect(await getFormioSchema(Model)).toEqual({ access: [], components: [ { disabled: false, input: true, key: "test", label: "Test", prefix: "The prefix", type: "textfield", validate: { required: false } } ], display: "form", machineName: "model", name: "model", submissionAccess: [], tags: [], title: "Model", type: "form" }); }); });