Skip to content

Commit f0d4142

Browse files
committed
fix(checkbox): Support optional boolean type for v0
1 parent 62100ab commit f0d4142

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

v0/src/tests/createHeadlessForm.test.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2328,7 +2328,6 @@ describe('createHeadlessForm', () => {
23282328
expect(handleValidation({ has_pet: false, pet_is_cat: true }).formErrors).toBeUndefined();
23292329
});
23302330

2331-
23322331
it('should set checkboxValue: true for optional boolean type', () => {
23332332
const schema = {
23342333
type: 'object',
@@ -2339,16 +2338,16 @@ describe('createHeadlessForm', () => {
23392338
'x-jsf-presentation': {
23402339
inputType: 'checkbox',
23412340
},
2342-
}
2341+
},
23432342
},
23442343
required: [],
23452344
};
23462345

23472346
const result = createHeadlessForm(schema);
2348-
2347+
23492348
const [optionalCheckbox] = result.fields;
2350-
expect(optionalCheckbox?.inputType).toBe('checkbox')
2351-
expect(optionalCheckbox?.checkboxValue).toBe(true)
2349+
expect(optionalCheckbox?.inputType).toBe('checkbox');
2350+
expect(optionalCheckbox?.checkboxValue).toBe(true);
23522351
});
23532352
});
23542353
});

0 commit comments

Comments
 (0)