import assert from 'assert'; import { shallow } from 'enzyme'; import React from 'react'; import { FormFieldView as FormField } from './FormField'; describe('', () => { const Foo = () =>
; it('should render a component for the input component', () => { const wrapper = shallow( true} component={Foo} /> ); const component = wrapper.find('Field'); assert.equal(component.length, 1); assert.equal(wrapper.prop('component'), Foo); }); it('should not render a component the field has an input', () => { const wrapper = shallow( true} component={Foo} input={{}} /> ); const component = wrapper.find('Field'); assert.equal(component.length, 0); }); });