Now that we are all set with the testing setup, we can start writing our first test. In this section, we will create a first test for the efforts component that we created in Chapter 8, Time Will Tell.
As Angular components are just classes, we can already test a lot of their functionality by instantiating the component class and testing its methods. Tests that can be performed like this should always be considered first. Tests that don't involve the rendering logic of your components can run without Angular compiling and bootstrap the component.
The efforts component uses a method to add a certain amount of hours to the effective time worked on a task. Within the template of the efforts component, we're providing three buttons, to add some common amounts of hours. Let's create our first test for the method, addEffectiveHours, in our efforts...