-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Labels
Description
I've run into a situation where the definition of a field as type: "array"
and an enum constraint results in the fieldName
becoming listed as undefined
const TF = {
fields: [{
"name": "ApplicationRequestStatusType",
"type": "array",
"title": "Application Request Status",
"description": "description goes here.",
"constraints": {
"required": true,
"enum": [
"duplicate",
"invalid",
"valid",
"other"
]
}
}],
}
// Tests
describe('Schema', () => {
it('specify correct fieldName', async () => {
{
const schema = await Schema.load(TF)
//FAIL
assert.equal(schema.fieldNames[0], "ApplicationRequestStatusType")
}
delete TF.fields[0].constraints
{
const schema = await Schema.load(TF)
//PASS
assert.equal(schema.fieldNames[0], "ApplicationRequestStatusType")
}
})