Skip to content

TDD kata inside a React app to practice or get into your testing workflow.

Notifications You must be signed in to change notification settings

chancesmith/tdd-todo-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TDD Todo workflow kata (~1 hour)

Write the tests that will use your app. Write your logic first with TDD. Do the UI later.

Currently, there is a failing test in Todo.test.ts for you to start by writing production code.

Hint: We need a class in ./src/api/Todo.ts made and imported into ./src/api/Todo.test.ts.

Next up

Clone/Fork and finish the logic writing your tests first.

TodoState

  • can be done
  • can be incomplete

Todo

  • takes init state (string)
  • throw error if not a valid todo string
  • init state is inComplete
  • can mark complete
  • can mark uncomplete

TodoList

  • takes init empty todo list
  • takes init of todo items (array of Todo instances)
  • get all todos
  • get all complete todos
  • get all inComplete todos
  • in the todo list, inComplete todos are above complete todos
  • add todo to list
  • new todo item is added to top of the list

App.ts

  • show an empty list of todos
  • show a list of todos
  • add item to list
  • mark todo complete
  • show completed tasks

About

TDD kata inside a React app to practice or get into your testing workflow.

Topics

Resources

Stars

Watchers

Forks