Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Angular 6 Unit Test Case

I am new to angular jasmine testing and stuck on how to test void functions. Please help me with below code on how do i test ngOnInit and submit function.

ngOnInit() {
    this.loginForm = this.fb.group({
      userName: ['', [Validators.required, Validators.minLength(8), Validators.maxLength(16)]],
      password: ['', [Validators.required, Validators.minLength(8), Validators.maxLength(16)]],
    });
  }

  submitForm() {
    this.router.navigate(['home']);
  }

Comments