@tsed/schema-formio
Version:
Transform Ts.ED Schema & JsonSchema to a valid Formio schema
36 lines (33 loc) • 769 B
text/typescript
import {getFormioSchema} from "../utils/getFormioSchema.js";
import {Textarea} from "./textarea.js";
describe("Textarea", () => {
it("should declare a model with Textarea field", async () => {
class Model {
@Textarea()
test: string;
}
expect(await getFormioSchema(Model)).toEqual({
components: [
{
autoExpand: false,
disabled: false,
input: true,
label: "Test",
key: "test",
type: "textarea",
validate: {
required: false
}
}
],
display: "form",
machineName: "model",
name: "model",
title: "Model",
type: "form",
submissionAccess: [],
access: [],
tags: []
});
});
});