Testing template-driven forms
To make sure we build robust and bug-free forms for end users, it is a really good idea to have tests relating to your forms. It makes the code more resilient and less prone to errors. In this recipe, you'll learn how to test your template-driven forms using unit tests.
The project for this recipe resides in
- Open the project in Visual Studio Code.
- Open the terminal and run
npm installto install the dependencies of the project.
- Once done, run
ng serve -o.
This should open the app in a new browser tab and you should see the app as follows:
How to do it…
We have the app from the previous recipe that contains a template-driven form...