         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
+  properties = _.extend({bubbles: true, cancelable: true, detail: 1}, properties...)
   event = new MouseEvent(type, properties)
   Object.defineProperty(event, 'which', get: -> properties.which) if properties.which?
   if properties.target?

    atom.commands.dispatch workspaceElement, 'project-find:show'

    waitsForPromise ->
      promise

  describe "result sorting", ->
    beforeEach ->

    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 ->
