text: import todos from './todos'
  import * as types from '../constants/ActionTypes'
  
  describe('todos reducer', () => {
    it('should handle ADD_TODO', () => {
      expect(
        todos.ADD_TODO([], {
          type: 'ADD_TODO',
          text: 'Run the tests'
        })
      ).toEqual([
        {
          text: 'Run the tests',
          completed: false,
          id: 0
        }
      ])
  
      expect(
        todos.ADD_TODO([
          {
            text: 'Use Redux',
            completed: false,
            id: 0
          }
        ], {
          type: 'ADD_TODO',
          text: 'Run the tests'
        })
      ).toEqual([
        {
          text: 'Run the tests',
          completed: false,
          id: 1
        }, {
          text: 'Use Redux',
          completed: false,
          id: 0
        }
      ])
  
      expect(
        todos.ADD_TODO([
          {
            text: 'Run the tests',
            completed: false,
            id: 1
          }, {
            text: 'Use Redux',
            completed: false,
            id: 0
          }
        ], {
          type: 'ADD_TODO',
          text: 'Fix the tests'
        })
      ).toEqual([
        {
          text: 'Fix the tests',
          completed: false,
          id: 2
        }, {
          text: 'Run the tests',
          completed: false,
          id: 1
        }, {
          text: 'Use Redux',
          completed: false,
          id: 0
        }
      ])
    })
  
    it('should handle DELETE_TODO', () => {
      expect(
        todos.DELETE_TODO([
          {
            text: 'Run the tests',
            completed: false,
            id: 1
          }, {
            text: 'Use Redux',
            completed: false,
            id: 0
          }
        ], {
          type: 'DELETE_TODO',
          id: 1
        })
      ).toEqual([
        {
          text: 'Use Redux',
          completed: false,
          id: 0
        }
      ])
    })
  
    it('should handle EDIT_TODO', () => {
      expect(
        todos.EDIT_TODO([
          {
            text: 'Run the tests',
            completed: false,
            id: 1
          }, {
            text: 'Use Redux',
            completed: false,
            id: 0
          }
        ], {
          type: 'EDIT_TODO',
          text: 'Fix the tests',
          id: 1
        })
      ).toEqual([
        {
          text: 'Fix the tests',
          completed: false,
          id: 1
        }, {
          text: 'Use Redux',
          completed: false,
          id: 0
        }
      ])
    })
  
    it('should handle COMPLETE_TODO', () => {
      expect(
        todos.COMPLETE_TODO([
          {
            text: 'Run the tests',
            completed: false,
            id: 1
          }, {
            text: 'Use Redux',
            completed: false,
            id: 0
          }
        ], {
          type: 'COMPLETE_TODO',
          id: 1
        })
      ).toEqual([
        {
          text: 'Run the tests',
          completed: true,
          id: 1
        }, {
          text: 'Use Redux',
          completed: false,
          id: 0
        }
      ])
    })
  
    it('should handle COMPLETE_ALL', () => {
      expect(
        todos.COMPLETE_ALL([
          {
            text: 'Run the tests',
            completed: true,
            id: 1
          }, {
            text: 'Use Redux',
            completed: false,
            id: 0
          }
        ], {
          type: 'COMPLETE_ALL',
        })
      ).toEqual([
        {
          text: 'Run the tests',
          completed: true,
          id: 1
        }, {
          text: 'Use Redux',
          completed: true,
          id: 0
        }
      ])
  
      // Unmark if all todos are currently completed
      expect(
        todos.COMPLETE_ALL([
          {
            text: 'Run the tests',
            completed: true,
            id: 1
          }, {
            text: 'Use Redux',
            completed: true,
            id: 0
          }
        ], {
          type: 'COMPLETE_ALL'
        })
      ).toEqual([
        {
          text: 'Run the tests',
          completed: false,
          id: 1
        }, {
          text: 'Use Redux',
          completed: false,
          id: 0
        }
      ])
    })
  
    it('should handle CLEAR_COMPLETED', () => {
      expect(
        todos.CLEAR_COMPLETED([
          {
            text: 'Run the tests',
            completed: true,
            id: 1
          }, {
            text: 'Use Redux',
            completed: false,
            id: 0
          }
        ], {
          type: 'CLEAR_COMPLETED'
        })
      ).toEqual([
        {
          text: 'Use Redux',
          completed: false,
          id: 0
        }
      ])
    })
  })
  