UNPKG

react-form-controlled

Version:

Intuitive react forms for building powerful applications

37 lines (34 loc) 874 B
import React from 'react'; import { mount } from 'enzyme'; import Form, { Input, Tbody } from '../src'; describe('Tbody', () => { it('should be able to create object', () => { const value = { rows: [123, 456] }; const wrapper = mount(React.createElement( Form, { value: value }, React.createElement( 'table', null, React.createElement( 'tbody', { name: 'rows' }, React.createElement( 'tr', null, React.createElement( 'td', null, React.createElement(Input, { name: '.' }) ) ) ) ) )); expect(wrapper.find('input').at(0).props().value).toBe(123); expect(wrapper.find('input').at(1).props().value).toBe(456); }); }); //# sourceMappingURL=Tbody.test.js.map