title: How to test an Angular directive was applied on the element
body: <p>In my app I have a button with a simple click event and a stopPropagation directive applied on it. </p>
  
  <p>Here is the component template:</p>
  
  <pre><code>&lt;button (click)="closeElement()" [stopPropagation]&gt;
      Close
  &lt;/button&gt;
  </code></pre>
  
  <p>The directive simply catch any event on the element and triggers an <code>$event.stopPropagation()</code> on any event.</p>
  
  <p>The directive is tested by itself with its own tests. But how, in the component, to test the directive is actually applied?</p>