import React from 'react'; import { shallow } from 'enzyme'; import { Form } from '../'; describe('Form', () => { it('should render with "form" tag', () => { const wrapper = shallow(
Yo!
); expect(wrapper.type()).toBe('form'); }); it('should render children', () => { const wrapper = shallow(
Yo!
); expect(wrapper.text()).toBe('Yo!'); }); it('should render with "form-inline" class', () => { const wrapper = shallow(
Yo!
); expect(wrapper.hasClass('form-inline')).toBe(true); }); it('should render additional classes', () => { const wrapper = shallow(
Yo!
); expect(wrapper.hasClass('other')).toBe(true); }); it('should render custom tag', () => { const wrapper = shallow(
Yo!
); expect(wrapper.type()).toBe('main'); }); });