public commit

This commit is contained in:
dswbx
2024-11-16 12:01:47 +01:00
commit 90f80c4280
582 changed files with 49291 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import { describe, expect, test } from "bun:test";
import { TextField } from "../../../../src/data";
import { runBaseFieldTests, transformPersist } from "./inc";
describe("[data] TextField", async () => {
test("transformPersist (config)", async () => {
const field = new TextField("test", { minLength: 3, maxLength: 5 });
expect(transformPersist(field, "a")).rejects.toThrow();
expect(transformPersist(field, "abcdefghijklmn")).rejects.toThrow();
expect(transformPersist(field, "abc")).resolves.toBe("abc");
});
runBaseFieldTests(TextField, { defaultValue: "abc", schemaType: "text" });
});