In this section, we will write our first Angular test for the login component. The steps involved in writing test cases are as follows:
- Identifying the class under test: The first step in writing unit test cases is to identify the dependencies. The login component constructor shows all the dependencies and is dependent on UserService, Router, AuthenticationService, and AngularFireAuth:
constructor(private userService: UserService, private router: Router, private authService: AuthenticationService, private angularFireAuth: AngularFireAuth)
- Creating all the mock or stubs classes: Once we identify all the dependencies, we need to eliminate these external dependencies and concentrate only on the component ...