title: Test directive attribute without template
body: <p>I'm trying to run a few unit tests on an Angular directive which is restricted to an Attribute.  For now I'm only trying to ascertain that the directive exists.  </p>
  
  <p>Does anyone know how to test a directive that is an attribute only?</p>
  
  <p>Here is a bare bones version of the <strong>directive</strong></p>
  
  <pre><code>function ResetCustomer() {
    return {
      restrict: 'A',
      link: (scope, elem) =&gt; {
  
        elem.bind('click', function() {
          //do stuff
        });
      }
    };
  }
  
  export default {
    name: 'resetCustomer',
    fn: ResetCustomer
  };
  </code></pre>
  
  <p>...  the <strong>HTML</strong></p>
  
  <pre><code>&lt;a class="brand" reset-customer&gt;
     &lt;img src="path/to/image.jpg"/&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>...and the <strong>test</strong></p>
  
  <pre><code>describe('Unit: ResetCustomer', () =&gt; {
  
    let element, scope, compile;
  
    beforeEach(() =&gt; {
      angular.mock.module('app');
      angular.mock.inject(($compile, $rootScope) =&gt; {
        scope = $rootScope.$new();
        compile = $compile;
        element = angular.element('&lt;a reset-customer&gt;&lt;/a&gt;');
        compile(element)(scope);
        scope.$digest();
      });
    });
  
    it('should exist', () =&gt; {
      expect(element).toBeDefined();
    }); 
  });
  </code></pre>