Testing components in action

In the previous topic, we learned about the Testbed utility class, and how to use it to test components in an isolated testing environment. We learned about the inject and async helpers, as well as how to mock components and services.

Now, let's use this knowledge to work on our tests for the efforts component. If you take a look at the template of our efforts component, you'll remember that we rely on two child components:

  • Duration: The two duration components within the template are used to enter both the duration values for estimated as well as effective efforts spent on tasks. It's a good idea to mock out that component when you want to perform tests on the efforts component. The duration component itself ...

Get Mastering Angular Components now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.