title: How to unit test a FormControl in Angular2
body: <p>My method under test is the following: </p>
  
  <pre><code>/**
     * Update properties when the applicant changes the payment term value.
     * @return {Mixed} - Either an Array where the first index is a boolean indicating
     *    that selectedPaymentTerm was set, and the second index indicates whether
     *    displayProductValues was called. Or a plain boolean indicating that there was an 
     *    error.
     */
    onPaymentTermChange() {
      this.paymentTerm.valueChanges.subscribe(
        (value) =&gt; {
          this.selectedPaymentTerm = value;
          let returnValue = [];
          returnValue.push(true);
          if (this.paymentFrequencyAndRebate) { 
            returnValue.push(true);
            this.displayProductValues();
          } else {
            returnValue.push(false);
          }
          return returnValue;
        },
        (error) =&gt; {
          console.warn(error);
          return false;
        }
      )
    }
  </code></pre>
  
  <p>As you can see paymentTerm is a form control that returns an Observable, which is then subscribed and the return value is checked. </p>
  
  <p>I can't seem to find any documentation on unit testing a FormControl. The closest I have come is this article about Mocking Http requests, which is a similar concept as they are returning Observables but I don't think it applies fully. </p>
  
  <p>For reference I am using Angular RC5, running tests with Karma and the framework is Jasmine. </p>