import React from 'react';
import { expect } from 'chai';
import { shallow } from 'enzyme';
import TaskList from '../../../src/components/Todo/TaskList';

const setup = (props = {
  tasks: [],
  onTaskToggle() {},
  onTaskDelete() {},
}) => shallow(<TaskList {...props} />);

describe('Component | ToDo | TaskList', () => {
  it('renders', () => {
    const wrapper = setup();

    expect(wrapper.find('ul').length).to.equal(1);
  });
});

import React from 'react';
import { expect } from 'chai';
import { shallow } from 'enzyme';
import TaskList from '../../../src/components/Todo/TaskList';

const setup = props => shallow(<TaskList {...props} />);

describe('Component | ToDo | TaskList', () => {
  it('renders', () => {
    const tasks = [
      {
        id: 1,
        description: 'test 1',
        isDone: false,
      },
      {
        id: 2,
        description: 'test 2',
        isDone: true,
      },
    ];

    const wrapper = setup({
      tasks,
      onTaskToggle() {},
      onTaskDelete() {},
    });

    expect(wrapper.find('ul')).to.have.lengthOf(1);
    expect(wrapper.find('ul').children()).to.have.lengthOf(tasks.length);
  });
});

Add tests for TaskList component
Add tests for TaskList component
