mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
public commit
This commit is contained in:
15
app/__test__/data/specs/fields/TextField.spec.ts
Normal file
15
app/__test__/data/specs/fields/TextField.spec.ts
Normal 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" });
|
||||
});
|
||||
Reference in New Issue
Block a user