MCPcopy Create free account
hub / github.com/effect-app/libs / testFieldInfo

Function testFieldInfo

packages/vue/test/form.test.ts:68–80  ·  view source on GitHub ↗
(fi: FieldInfo<T>)

Source from the content-addressed store, hash-verified

66}) {}
67
68function testFieldInfo<T>(fi: FieldInfo<T>) {
69 expect(fi).toBeInstanceOf(Object)
70 expect(fi._tag).toBe("FieldInfo")
71 expect(["text", "float", "int"]).toContain(fi.type)
72 expect(fi.rules).toBeInstanceOf(Array)
73 fi.rules.forEach((r) => {
74 expect(r).toBeInstanceOf(Function)
75 })
76 expect(fi.metadata).toBeInstanceOf(Object)
77 expect(fi.metadata.maxLength === void 0 || typeof fi.metadata.maxLength === "number").toBeTruthy()
78 expect(fi.metadata.minLength === void 0 || typeof fi.metadata.minLength === "number").toBeTruthy()
79 expect(typeof fi.metadata.required === "boolean").toBeTruthy()
80}
81
82function testUnionFieldInfo<T>(ufi: UnionFieldInfo<T[]>) {
83 expect(ufi).toBeInstanceOf(Object)

Callers 4

testUnionFieldInfoFunction · 0.85
testNestedFieldInfoFunction · 0.85
form.test.tsFile · 0.85

Calls 1

forEachMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…