title: Perform ngx-spinner unit testing
body: <p>I am using <a href="https://github.com/Napster2210/ngx-spinner" rel="nofollow noreferrer">ngx-spinner</a> on my component to show a loading indictor on the page on some remote call process. On my component I have the following code for ngx spinner:</p>
  
  <pre><code>&lt;ngx-spinner [fullScreen]="true" type="ball-clip-rotate" size="medium" bdColor="rgba(51,51,51,0.1)" color="grey"&gt;
  &lt;/ngx-spinner&gt;
  </code></pre>
  
  <p>At the component on init while the page is loading I am showing the spinner like this:"</p>
  
  <pre><code>  constructor(
      private spinner: NgxSpinnerService) {
  
    }
  
    ngOnInit() {
  
      this.spinner.show();
  </code></pre>
  
  <p>and after the I am making a remote call to the server and when that work is done I am hiding the spinner.</p>
  
  <p>My goal is to create unit test for the same i.e when the page is loaded I need to make sure the spinner is showing on the page. In order to do that I wrote the following test case:</p>
  
  <pre><code>  it('should show loading indicator if the page is not loaded', () =&gt; {
  
      // pageLoaded should be try because the form will be loaded only when that is true based on ng if
  
      const element = getElementByTag('ngx-spinner');
  
      //What to write here?
  
    });
  </code></pre>
  
  <p>I am getting the element there in my test but I was not able to get the way to detect whether it is visible or not. I tried element.nativeElement.visible but it returned as null.</p>