Skip to content

Commit ac6ef3d

Browse files
committed
feat(useFormKitSchema): allow also boolean value for render property
1 parent f6f1193 commit ac6ef3d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/useFormKitSchema.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect, it } from 'vitest'
22
import { useFormKitSchema } from '../src/composables'
33

44
function renderToBoolean(element: any): boolean {
5-
return !!element?.if
5+
return element.if === 'true'
66
}
77

88
it('add element', () => {
@@ -37,6 +37,9 @@ it('add group', () => {
3737
expect(group.$formkit).toBe('group')
3838
expect(renderToBoolean(group)).toBe(true)
3939
expect(group.name).toBe('name')
40+
41+
const hiddenGroup = addGroup('name', [], false)
42+
expect(renderToBoolean(hiddenGroup)).toBe(false)
4043
})
4144

4245
it('add list', () => {

0 commit comments

Comments
 (0)