import { expect, test } from "vitest" import { TEXT_INPUTOR_TYPE_NAME, TextInputorController } from "#Source/form/index.ts" test("TextInputorController.getSchema exposes length constraints and updateValue truncates by maxLength", async () => { const controller = new TextInputorController({ id: "text-id", value: "hello", minLength: 2, maxLength: 4, }) await controller.waitForReady() await controller.updateValue("planet") expect(await controller.getSchema()).toEqual({ inputorTypeName: TEXT_INPUTOR_TYPE_NAME, id: "text-id", name: `text-text-id`, placeholder: "", value: "plan", isVoid: false, isFocused: false, isTouched: false, isDirty: true, isDisabled: false, isDebugMode: false, minLength: 2, maxLength: 4, }) })