title: Angular 6 - Unit Testing Mat-Select
body: <p>1: The mat-select has 4 values, 1,2,3,4. </p>
  
  <p>The code below works good for the select. So I'd like to share if it helps the readers.</p>
  
  <pre><code>it('check the length of drop down', async () =&gt; {
  
      const trigger = fixture.debugElement.query(By.css('.mat-select-trigger')).nativeElement;
      trigger.click();
      fixture.detectChanges();
      await fixture.whenStable().then(() =&gt; {
          const inquiryOptions = fixture.debugElement.queryAll(By.css('.mat-option-text'));
          expect(inquiryOptions.length).toEqual(4);
      });
  });
  </code></pre>
  
  <p>2: I need another test to verify the default value in the same
  mat-select is 3 or not. When page loads the default value for the drop down is set to 3.</p>
  
  <pre><code>it('should validate the drop down value if it is set by default', async () =&gt; {
  
      const trigger = fixture.debugElement.query(By.css('.mat-select-trigger')).nativeElement;
      trigger.click();
      fixture.detectChanges();
      await fixture.whenStable().then(() =&gt; {
          const inquiryOptions = fixture.debugElement.queryAll(By.css('.mat-option-text'));
          const value = trigger.options[0].value;
          expect(value).toContain(3);
      });
  });
  </code></pre>
  
  <p>Any help is appreciated. </p>