O'Reilly logo

Mastering Angular Components by Gion Kunz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required