title: angular2 test, how to test event is bound to an element
body: <p>I am writing an angular2 unit test for a component.
  With fully using JQuery it's possible to find what event is bound to an element. However in Angular2, I am not sure it's possible or not</p>
  
  <p>For example, the following code has a click event, which is a public function of a component</p>
  
  <pre><code>      &lt;button (click)="doLogin()" [disabled]="myDisabled"&gt;Login&lt;/button&gt;
  </code></pre>
  
  <p>By reading DOM element, I can make it sure all properties and data binding is correct by running a test. Only thing that I don't know is, "<code>event</code> binding is correct or not" because the generated html is like the following</p>
  
  <pre><code>      &lt;button&gt;Login&lt;/button&gt;
  </code></pre>
  
  <p>I want to make it sure someone does not delete this event binding in the future by writing a test for it.</p>
  
  <p>In summary, how do I know event is properly bound to DOM element?</p>
  
  <p>EDIT: 
  Is there a way to know there is click event without actually clicking it?</p>