Angular2 FormBuilder unit testing
<p>I have two question in regards to mocking Formbuilder in Angular2.</p>

<p>1) How do I mock formBuilder in a spec? Are there any given mocks that we can use? I would like to for instance, update the values of a form in my spec, and then test to see if the form is still valid - or test the functionality of methods in my component that update a formbuilder group, or determine if a formbuilder group is valid.</p>

<p>2) How do I deal with the following error given that fb is a DI injection of Formbuilder in a spec?</p>

<p><code>null is not an object (evaluating 'this.fb.group')</code></p>

<p>when the component is as follows:</p>

<pre><code>export class LoginComponent implements OnInit {
  constructor( private fb: FormBuilder ) {}

  ngOnInit() {
    this.loginForm = this.fb.group({
      'email': this.user.email,
      'password': this.user.password
    });
  }
}
</code></pre>