content: import reducer from '../src/reducers/todos'
  import * as types from '../src/constants/ActionTypes'
  import { spy } from 'sinon';
  
  
  import React from 'react'
  import TestUtils from 'react-addons-test-utils'
  import { mount, render, shallow } from 'enzyme';
  
  import Header from '../src/components/Header'
  
  function setup () {
    let props = {
      addTodo: spy()
    }
  
    let renderer = TestUtils.createRenderer()
    renderer.render(<Header {...props} />)
    let output = renderer.getRenderOutput()
  
    return {
      props,
      output,
      renderer
    }
  }
  
  describe('component', () => {
  
    describe('[TestUtils]  Header', () => {
  
      it('should render correctly', () => {
        const { output } = setup()
        output.type.should.be.equal('header')
  
        let [ h1, input ] = output.props.children
  
        h1.type.should.be.equal('h1')
        h1.props.children.should.be.equal('Todo List')
        input.type.should.be.equal("input")
        input.props.placeholder.should.be.equal('add todo list')
      })
  
      it('should call addTodo if length of text is greater than 0', () => {
        const { output, props } = setup()
        let [ h1, input, button ] = output.props.children
        button.props.onClick('')
  
        props.addTodo.callCount.should.be.equal(0)
  
        // props.addTodo()
        // input.props.onClick()
        // props.addTodo.callCount.should.be.equal(1)
      })
    })
  
    describe('[enzyme]  Header', () => {
  
      it('should render correctly', () => {
        let props = {
          addTodo: spy()
        }
  
        const wrapper = shallow(
          <Header { ...props } />
        ).children()
  
        let [ h1, input, button ] = wrapper.nodes
  
        h1.type.should.be.equal("h1")
        h1.props.children.should.be.equal("Todo List")
        input.type.should.be.equal("input")
        input.props.placeholder.should.be.equal("add todo list")
        button.type.should.be.equal("button")
  
      })
  
      it('should call addTodo if length of text is greater than 0', () => {
        let props = {
          addTodo: spy()
        }
  
        const wrapper = shallow(
          <Header { ...props } />
        )
  
        const children = wrapper.children();
  
        let input = children.at(1);
        let button = children.at(2);
        wrapper.setState({ text: 'text is greater than 0'});
        props.addTodo.callCount.should.be.equal(0);
        button.props().onClick();
        props.addTodo.callCount.should.be.equal(1);
      })
    })
  })