     atom.commands.dispatch workspaceElement, 'project-find:show'
 
     waitsForPromise ->
-      promise
+      activationPromise
 
   describe "result sorting", ->
     beforeEach ->

        expect(fileIconClasses).not.toContain('third-icon-class fourth-icon-class icon')
        expect(fileIconClasses).toContain('icon-file-text icon')

  # Keep. Useful for debugging.
  logSelectedIndex = ->
    paths = resultsView.find('.path')
    selectedView = resultsView.find('.selected')

    if selectedView.hasClass('path')
      console.log 'PATH', paths.index(selectedView)
    else
      for pathElement, pathIndex in paths
        index = $(pathElement).find('.search-result').index(selectedView)
        console.log pathIndex, index if index > -1
        break

buildMouseEvent = (type, properties...) ->
  properties = _.extend({bubbles: true, cancelable: true}, properties...)
  properties.detail ?= 1
  event = new MouseEvent(type, properties)
  Object.defineProperty(event, 'which', get: -> properties.which) if properties.which?
  if properties.target?

    jasmine.attachToDOM(workspaceElement)
    atom.config.set('core.excludeVcsIgnoredPaths', false)
    atom.project.setPaths([path.join(__dirname, 'fixtures')])
    activationPromise = atom.packages.activatePackage("find-and-replace").then ({mainModule}) ->
      mainModule.createViews()
      {projectFindView} = mainModule
      spy = spyOn(projectFindView, 'confirm').andCallFake ->
