So far, we have tested our components with plain vanilla JavaScript. The fact that components are in regular classes makes this possible. However, this can only be done for very simple use cases. As soon as we want to test components for things that involve template compilation, user interaction on components, change detection, or dependency injection, we'll need to get a little help from Angular to perform our tests.
Angular comes with a whole bunch of testing tools that can help us out here. In fact, the platform-agnostic way that Angular is built allows us to exchange the regular view adapter with a debug view adapter. This enables us to render components in such a way that we can inspect them in greater detail.
The Angular CLI has already enabled this for us, and if you check the content of the file src/test.ts, you can see that there&apos...