UNPKG

wix-style-react

Version:
43 lines (41 loc) 1.45 kB
import React from 'react'; import ReactTestUtils from 'react-dom/test-utils'; import TextArea from './TextArea'; import InputArea from '../InputArea'; import { textAreaTestkitFactory } from '../../testkit'; import { textAreaTestkitFactory as enzymeTextAreaTestkitFactory } from '../../testkit/enzyme'; import { mount } from 'enzyme'; describe('TextArea', function () { describe('testkit', function () { it('should exist', function () { var div = document.createElement('div'); var dataHook = 'compHook'; var wrapper = div.appendChild(ReactTestUtils.renderIntoDocument(React.createElement( 'div', null, React.createElement( TextArea, { dataHook: dataHook }, React.createElement(InputArea, null) ) ))); var textAreaTestkit = textAreaTestkitFactory({ wrapper: wrapper, dataHook: dataHook }); expect(textAreaTestkit.exists()).toBeTruthy(); }); describe('enzyme testkit', function () { it('should exist', function () { var dataHook = 'myDataHook'; var wrapper = mount(React.createElement( TextArea, { dataHook: dataHook }, React.createElement(InputArea, null) )); var textAreaTestkit = enzymeTextAreaTestkitFactory({ wrapper: wrapper, dataHook: dataHook }); expect(textAreaTestkit.exists()).toBeTruthy(); }); }); }); });