title: How to test subscribe in jasmine /angular/ karma
body: <p>I am writing a test for a component which has a method with subscribe and error handlers.
  my <code>.ts</code> file has this</p>
  <pre><code>public viewDetails(orderNumber, orderType, orderCompany, businessUnitDesc): void {
      this.showingDetails = true;
      this.detailsLoading = true;
      this.spinnerMessage = 'Loading Details';
   
      const ordDet = {
          orderNumber,
          orderType,
          orderCompany
      };
   
      this.businessUnitDesc = businessUnitDesc;
   
      this.http.post&lt;OrderDetailsResponse&gt;(this.orderDetailsUrl, ordDet).subscribe(data =&gt; {
   
          this.detailJsonString = JSON.stringify(data);
  
          this.orderDetails = data;
        
          this.freightHandlingCodeDesc = this.modeOfTrnDesc = this.routeCodeDesc = '';
          this.getDescForFreightHandlingCode(this.orderDetails.freightHandlingCode);
          this.getDescForModeOfTrnsCode(this.orderDetails.modeofTrn);
          this.getDescForRouteCode(this.orderDetails.routeCode);
   
          this.stopDetailsLoading();
          this.appInsightsService.logEvent('Order Details', {orderNumber});
      },
      error =&gt; {
         this.detailsLoading = false;
         this.appInsightsService.logException(error);
         this.authService.viewStandardErrorMessage();
      });
  </code></pre>
  <p>}</p>
  <p>I have have tried to test for it in <code>.spec.ts</code> file like this:</p>
  <pre><code>it ('should view details', () =&gt; {
      component.viewDetails(1, 'a', 'b', 'c');
      expect(component.showingDetails).toBe(true);
      expect(component.detailsLoading).toBe(true);
      expect(component.spinnerMessage).toBe('Loading Details');
  });
  </code></pre>
  <p>My test only test for the first part. How do I test for the rest of the function  including subscribe and errors?</p>