import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import getMuiTheme from 'src/styles/getMuiTheme';
import Badge from 'src/badge';

describe('<Badge />', () => {

  const badgeTheme = getMuiTheme().badge;
  const testChildren = <div className="unique">Hello World</div>;

  it('renders children and badgeContent', () => {
    const wrapper = shallow(
      <Badge badgeContent={10}>{testChildren}</Badge>
    );

    assert.ok(wrapper.contains(testChildren), 'should contain the children');
    assert.ok(wrapper.find('span').length, 'should contain the badgeContent');
  });

  it('renders children and overwrite badge styles', () => {
    const badgeStyle = {
        backgroundColor: 'red'
    };
    const wrapper = shallow(
      <Badge badgeContent={10} badgeStyle={badgeStyle}>{testChildren}</Badge>
    );

    assert.ok(wrapper.contains(testChildren), 'should contain the children');
    assert.equal(wrapper.find('span').node.props.style.backgroundColor, badgeStyle.backgroundColor, 'should overwrite badge backgroundColor');
  });

  it('renders children by default', () => {
    const wrapper = shallow(
      <Badge>{testChildren}</Badge>
    );

    assert.ok(wrapper.contains(testChildren), 'should contain the children');
  });

  it('renders children and className', () => {
    const wrapper = shallow(
      <Badge className="testClassName">{testChildren}</Badge>
    );

    assert.ok(wrapper.contains(testChildren), 'should contain the children');
    assert.ok(wrapper.is('.testClassName'), 'should contain the className');
  });

  it('renders children and have primary styles', () => {
    const wrapper = shallow(
      <Badge badgeContent={10} primary={true}>{testChildren}</Badge>
    );

    assert.ok(wrapper.contains(testChildren), 'should contain the children');
    assert.equal(wrapper.find('span').node.props.style.backgroundColor, badgeTheme.primaryColor, 'should have primary badge backgroundColor');
    assert.equal(wrapper.find('span').node.props.style.color, badgeTheme.primaryTextColor, 'should have primary badge text color');
  });

  it('renders children and have secondary styles', () => {
    const wrapper = shallow(
      <Badge badgeContent={10} secondary={true}>{testChildren}</Badge>
    );

    assert.ok(wrapper.contains(testChildren), 'should contain the children');
    assert.equal(wrapper.find('span').node.props.style.backgroundColor, badgeTheme.secondaryColor, 'should have secondary badge backgroundColor');
    assert.equal(wrapper.find('span').node.props.style.color, badgeTheme.secondaryTextColor, 'should have secondary badge text color');
  });

  it('renders children and overwrite root styles', () => {
    const style = {
        backgroundColor: 'red'
    };
    const wrapper = shallow(
      <Badge style={style}>{testChildren}</Badge>
    );

    assert.ok(wrapper.contains(testChildren), 'should contain the children');
    assert.equal(wrapper.node.props.style.backgroundColor, style.backgroundColor, 'should overwrite badge backgroundColor');
  });

});

@@ -691,34 +691,32 @@
 Style = %7B%0A      
-  
 backgroundColor:
@@ -713,32 +713,33 @@
 oundColor: 'red'
+,
 %0A    %7D;%0A    cons
@@ -990,24 +990,28 @@
 groundColor,
+%0A   
  badgeStyle.
@@ -1891,32 +1891,36 @@
 backgroundColor,
+%0A   
  badgeTheme.prim
@@ -2028,32 +2028,36 @@
 ops.style.color,
+%0A   
  badgeTheme.prim
@@ -2430,24 +2430,28 @@
 groundColor,
+%0A   
  badgeTheme.
@@ -2575,16 +2575,20 @@
 e.color,
+%0A   
  badgeTh
@@ -2742,26 +2742,24 @@
 e = %7B%0A      
-  
 backgroundCo
@@ -2768,16 +2768,17 @@
 r: 'red'
+,
 %0A    %7D;%0A
@@ -3015,32 +3015,36 @@
 backgroundColor,
+%0A   
  'should overwri

fix eslint