import React from 'react';
import TestUtils from 'react-dom/test-utils';
import { shallow } from 'enzyme';
import { elementsTagTest, rootTagTest } from '../../utils/helpers/tags/tags-specs';
import AppWrapper from './app-wrapper';

describe('app wrapper', () => {
  let instance, wrapper;

  beforeEach(() => {
    instance = TestUtils.renderIntoDocument( <AppWrapper className='foobar'>foo</AppWrapper>);
    wrapper = shallow(<AppWrapper className='foobar' data-element='app-wrapper' data-role='contacts'>foo</AppWrapper>);
  });

  it('renders the children', () => {
    let div = TestUtils.findRenderedDOMComponentWithTag(instance, 'div');
    expect(div.textContent).toEqual('foo');
  });

  it('renders with correct classes', () => {
    let div = TestUtils.findRenderedDOMComponentWithTag(instance, 'div');
    expect(div.className).toEqual('carbon-app-wrapper foobar');
  });

  describe("tags", () => {
    describe("on component", () => {
      let wrapper = shallow(<AppWrapper data-element='bar' data-role='baz' />);

      it('include correct component, element and role data tags', () => {
        rootTagTest(wrapper, 'app-wrapper', 'bar', 'baz');
      });
    });
  });
});

@@ -112,25 +112,8 @@
 rt %7B
- elementsTagTest,
  roo
@@ -258,17 +258,8 @@
 ance
-, wrapper
 ;%0A%0A 
@@ -377,128 +377,8 @@
 %3E);%0A
-    wrapper = shallow(%3CAppWrapper className='foobar' data-element='app-wrapper' data-role='contacts'%3Efoo%3C/AppWrapper%3E);%0A
   %7D)

Fix linting errors