content: import React from 'react'
  import { createRenderer } from 'react-test-renderer/shallow';
  import MeetingMinuteItem from './MeetingMinuteItem'
  import MeetingMinuteTextInput from './MeetingMinuteTextInput'
  
  const setup = ( editing = false ) => {
    const props = {
      meetingMinute: {
        id: 0,
        text: 'Dummy meeting minutes',
        archived: false
      },
      editMeetingMinute: jest.fn(),
      deleteMeetingMinute: jest.fn(),
      archiveMeetingMinute: jest.fn()
    }
  
    const renderer = createRenderer()
  
    renderer.render(
      <MeetingMinuteItem {...props} />
    )
  
    let output = renderer.getRenderOutput()
  
    if (editing) {
      const label = output.props.children.props.children[1]
      output = renderer.getRenderOutput()
    }
  
    return {
      props: props,
      output: output,
      renderer: renderer
    }
  }
  
  describe('components', () => {
    describe('MeetingMinuteItem', () => {
      it('initial render', () => {
        const { output } = setup()
  
        expect(output.type).toBe('li')
        expect(output.props.className).toBe('')
  
        const div = output.props.children
  
        expect(div.type).toBe('div')
        expect(div.props.className).toBe('view')
  
        const [ input, label, buttonEdit, buttonDestroy ] = div.props.children
  
        expect(input.type).toBe('input')
        expect(input.props.checked).toBe(false)
  
        expect(buttonEdit.type).toBe('button')
        expect(buttonEdit.props.className).toBe('btn edit-btn')
  
        expect(buttonDestroy.type).toBe('button')
        expect(buttonDestroy.props.className).toBe('destroy')
      })
  
      it('input onChange should call archiveMeetingMinute', () => {
        const { output, props } = setup()
        const input = output.props.children.props.children[0]
        input.props.onChange({})
        expect(props.archiveMeetingMinute).toBeCalledWith(0)
      })
  
      it('button onClick should call deleteMeetingMinute', () => {
        const { output, props } = setup()
        const button = output.props.children.props.children[3]
        button.props.onClick({})
        expect(props.deleteMeetingMinute).toBeCalledWith(0)
      })
    })
  })
  