       element = $compile("<mac-tag-autocomplete></mac-tag-autocomplete>") $rootScope
       $rootScope.$digest()
 
-      expect(element.hasClass("mac-tag-autocomplete")).toBeTruthy()
+      expect(hasClass(element, "mac-tag-autocomplete")).toBeTruthy()
 
     it "should set default value and label attribute on mac-autocomplete", ->
       element = $compile("<mac-tag-autocomplete></mac-tag-autocomplete>") $rootScope
       $rootScope.$digest()
 
-      textInput = $(".mac-autocomplete", element)
-      expect(textInput.attr("mac-autocomplete-label")).toBe "name"
+      textInput = element[0].querySelector ".mac-autocomplete"
+      expect(textInput.getAttribute("mac-autocomplete-label")).toBe "name"
 
     it "should set value and label attribute on mac-autocomplete", ->
       element = $compile("<mac-tag-autocomplete mac-tag-autocomplete-label='test-name' mac-tag-autocomplete-value='test-id'></mac-tag-autocomplete>") $rootScope
       $rootScope.$digest()
 
-      textInput = $(".mac-autocomplete", element)
-      expect(textInput.attr("mac-autocomplete-label")).toBe "test-name"
+      textInput = element[0].querySelector ".mac-autocomplete"
+      expect(textInput.getAttribute("mac-autocomplete-label")).toBe "test-name"
 
     it "should pass empty string as key and value", ->
       element = $compile("<mac-tag-autocomplete mac-tag-autocomplete-label='' mac-tag-autocomplete-value=''></mac-tag-autocomplete>") $rootScope
       $rootScope.$digest()
 
-      textInput = $(".mac-autocomplete", element)
-      expect(textInput.attr("mac-autocomplete-label")).toBe ""
+      textInput = element[0].querySelector ".mac-autocomplete"
+      expect(textInput.getAttribute("mac-autocomplete-label")).toBe ""
 
     it "should set query attribute on mac-autocomplete", ->
       element = $compile("<mac-tag-autocomplete mac-tag-autocomplete-query='query'></mac-tag-autocomplete>") $rootScope
       $rootScope.$digest()
 
-      textInput = $(".mac-autocomplete", element)
-      expect(textInput.attr("mac-autocomplete-query")).toBe "query"
+      textInput = element[0].querySelector ".mac-autocomplete"
+      expect(textInput.getAttribute("mac-autocomplete-query")).toBe "query"
 
     it "should set delay attribute on mac-autocomplete", ->
       element = $compile("<mac-tag-autocomplete mac-tag-autocomplete-delay='100'></mac-tag-autocomplete>") $rootScope
       $rootScope.$digest()
 
-      textInput = $(".mac-autocomplete", element)
-      expect(textInput.attr("mac-autocomplete-delay")).toBe "100"
+      textInput = element[0].querySelector ".mac-autocomplete"
+      expect(textInput.getAttribute("mac-autocomplete-delay")).toBe "100"
 
     it "should set the url attribute on mac-autocomplete", ->
       $rootScope.url = "/test"

  $timeout   = null
  keys       = null

  beforeEach module("Mac")
  beforeEach module("template/tag_autocomplete.html")
  beforeEach module("template/autocomplete.html")

      element = $compile("<mac-tag-autocomplete mac-tag-autocomplete-on-keydown='keydown()'></mac-tag-autocomplete>") $rootScope
      $rootScope.$digest()

      textInput = element[0].querySelector ".mac-autocomplete"
      browserTrigger textInput, "keydown"

      expect($rootScope.keydown).toHaveBeenCalled()
