title: Testing scrollintoview while unit testing angular
body: <p>When unit testing a scrollintoview() method in Angular 2+, I receive an error -> <em>"Failed: Cannot read property 'scrollIntoView' of undefined" in Angular 2+</em></p>
  
  <p>Here is my scrollintoview code:</p>
  
  <pre><code> document.getElementsByClassName('class')[0].scrollIntoView();
  </code></pre>
  
  <p>Any ideas on how to resolve this trough an execute script?</p>