Unit Testing Forms and Events

Learn how to test a form using Angular's change detection routine, check form validity, and spy on an injected instance.

Testing the form

Now that the LoginComponent is being created correctly and has all of the services that it needs, we can focus on testing the form itself.

Let’s start with a test for the initial state of the form as follows:

Get hands-on with 1400+ tech skills courses.