foxhound87 / mobx-react-form

Reactive MobX Form State Management
https://foxhound87.github.io/mobx-react-form
MIT License
1.09k stars 129 forks source link

unit test hasUnifiedProps() fails #598

Closed riceyeh closed 2 years ago

riceyeh commented 2 years ago

The following test for hasUnifiedProps function in utils.ts fails. The root cause of this problem seems from the implementation of $getKeys(), which only considers the first field's properties in fields, which has no other properties but 'name'.

describe.only('utils', () => { it('hasUnifiedProps', () => { const fields = [ { name: 'field1' }, { name: 'field2', label: 'label 2' } ] expect(hasUnifiedProps({fields})).to.be.true // fails but fields has 'label' property, so it is unified }) })