       element = $compile("<mac-tag-autocomplete mac-tag-autocomplete-on-keydown='keydown()'></mac-tag-autocomplete>") $rootScope
       $rootScope.$digest()
 
-      textInput = $(".mac-autocomplete", element)
+      textInput = element[0].querySelector ".mac-autocomplete"
       browserTrigger textInput, "keydown"
 
       expect($rootScope.keydown).toHaveBeenCalled()

  $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-selected='selected' mac-tag-autocomplete-on-keydown='keydown()' mac-tag-autocomplete-disabled='true'></mac-tag-autocomplete>") $rootScope
      $rootScope.$digest()

      textInput = element[0].querySelector ".mac-autocomplete"
      $rootScope.$$childHead.textInput = "Testing"
      angular.element(textInput).triggerHandler
        type:  "keydown"
        which: keys.ENTER

      $timeout.flush()

