Test - diazsandra/todo-list-app GitHub Wiki

Test framework

The test framework used is Jasmine. Jasmine enables writing testing in a behavior-based development style and includes a library of assertions (expectations) and a double test library (spy).

Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM. And it has a clean, obvious syntax so that you can easily write tests.

All tests are contained in the file located in test/ControllerSpec.js. New tests can be added to this file.

The tests are easily run by opening the file test/SpecRunner.html in a browser.

Automatic Jasmine testing

It shoulds:

  • Show entries on start-up

The array has to be empty when the application start

  • Show active entries

Shows total count of the tasks, array can be empty or filled it with the tasks

  • Show completed entries

When a taks is complete = false

  • Show the content block when todos exists

Create a list of the tasks

  • Highlight "All" filter by default

Sets 'all' as default, takes total count, even if it's empty

  • Toggle all todos to completed

Updates all tasks as completed (model component)

  • Update the view

Updates the status as completed (view component)

  • Add a new todo to the model

Adds new task to the list

  • Remove an entry from the model

Removes todo task (model component), empty array