Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fieldset): Support customProperties with sub-fields clashing with reserved words. #64

Merged
merged 8 commits into from
Feb 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions src/tests/createHeadlessForm.customValidations.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,58 @@ describe('createHeadlessForm() - custom validations', () => {
},
});
});
it('renders subfields with reserved keywords and jsfOption customization', () => {
joeynimu marked this conversation as resolved.
Show resolved Hide resolved
const {fields} = createScenario({
joeynimu marked this conversation as resolved.
Show resolved Hide resolved
schema: {
"properties": {
"dog": {
joeynimu marked this conversation as resolved.
Show resolved Hide resolved
"title": "Dog details",
"description": "Fieldset description",
"x-jsf-presentation": {
"inputType": "fieldset"
},
"properties": {
"name": {
"title": "Dogs name",
"x-jsf-presentation": {
"inputType": "text"
},
"type": "string"
},
"type": {
"title": "Breed type",
"x-jsf-presentation": {
"inputType": "number"
},
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
},
"required": [
"dog"
]
},
config: {
customProperties: {
dog: {
customProperties:{
name: {
label: "What's your dogs name"
joeynimu marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
}
}
})
expect(fields.length).toBe(1);
expect(fields[0].fields.length).toBe(2);
expect(fields[0].fields[0].label).toBe("What's your dogs name");
joeynimu marked this conversation as resolved.
Show resolved Hide resolved
});
});

describe('in conditional fields', () => {
Expand Down
Loading