title: TriggerEventHandler in unit testing angular 4
body: <p>I had an element</p>
  
  <pre><code>&lt;button class="next-btn" (mouseup)="someMethod()"&gt;Next&lt;/button&gt;
  </code></pre>
  
  <p>I want to simulate mouseup event in testing and i do this </p>
  
  <pre><code>const nextBtnElem = fixture.debugElement.nativeElement;
  const elem = nextBtnElem.getElementsByTagName('button')[1]
  elem.triggerEventHandler('mouseup', null);
  </code></pre>
  
  <p>it doesn't work, but if i change it like this </p>
  
  <pre><code>const nextBtnElem = fixture.debugElement.query(By.css('.next-btn');
  nextBtnElem.triggerEventHandler('mouseup', null);
  </code></pre>
  
  <p>Now its working. I can't understand why first optional doesn't work?</p>