title: Set the value of a ReactiveForm in a Jasmine unit test
body: <p>I'm trying to learn how to unit test a reactiveForm in Angular. </p>
  
  <p>what I want to do is set the value of a field and then check if the form is valid after adding the value.</p>
  
  <p>This is where i've got to:</p>
  
  <p>snippet from jasmine test</p>
  
  <pre><code>it('Filled in form is valid', async(() =&gt; {
        const fixture = TestBed.createComponent(AppComponent);
        fixture.detectChanges();
  
        const component = fixture.componentInstance; 
        component.userForm.setValue({
          value:{
                firstName : ["Bob"]
                }
        })
   }));
  </code></pre>
  
  <p>the form:</p>
  
  <pre><code>&lt;form [formGroup]="userForm" novalidate (ngSubmit)="onSubmit()" &gt;
    &lt;div class="form-group"&gt;
      &lt;label class="center-block"&gt;first Name:
        &lt;input class="form-control" formControlName="firstName"&gt;
      &lt;/label&gt;
      &lt;label class="center-block"&gt;first Name:
        &lt;input class="form-control" formControlName="lastName"&gt;
      &lt;/label&gt;
      &lt;button type="submit" &gt;Submit&lt;/button&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I get the following error message from Karma:</p>
  
  <blockquote>
    <p>Failed: Must supply a value for form control with name: 'firstName'.</p>
  </blockquote>