Follow along in this two part series as we walk through the steps to test for bugs in AngularJS.
First, we will write unit tests that reflect the intended behavior and then fix the bug so these tests pass. The goal is to improve code maintainability and reduce regression bugs.Download or clone the repo to follow along – each step has a corresponding branch to checkout.
We are going to focus on the play/pause functionality of the player. By right-clicking on the video element, we can see that the video will play and pause.
We will write tests for both the controller and the directive for this button in order to make sure our tests are small, consistent and maintainable.