Closed riceyeh closed 1 year ago
Hi, The following test shows fields for array items are created when update a field in a no-fallback form with array value:
` describe.only('no fallback', () => { it('no new field for array value', () => { const fields = ['prop'] const values = { prop: [1, 2, 3] } const form = new Form({fields, values}, {name: 'Form without fallback', options: {fallback: false}})
expect(form.select('prop.0',undefined, false)).to.be.undefined // <--- fail expect(form.$('prop').value).to.deep.equal([1, 2, 3]) form.update({prop: [4, 5, 6]}) expect(form.select('prop.0', undefined, false)).to.be.undefined expect(form.$('prop').value).to.deep.equal([4, 5, 6]) })
}) `
Hi, The following test shows fields for array items are created when update a field in a no-fallback form with array value:
` describe.only('no fallback', () => { it('no new field for array value', () => { const fields = ['prop'] const values = { prop: [1, 2, 3] } const form = new Form({fields, values}, {name: 'Form without fallback', options: {fallback: false}})
}) `