       pane = atom.workspace.getActivePane()
 
       dispatchCommand('toggle-buffer-finder')
-      {filePath} = bufferView.getSelectedItem()
-      atom.commands.dispatch bufferView.filterEditorView.element, 'pane:split-left'
+      waitForPathsToDisplay bufferView
+
+      filePath = null
+      runs ->
+        {filePath} = bufferView.getSelectedItem()
+        atom.commands.dispatch bufferView.filterEditorView.element, 'pane:split-left'
 
       waitsFor ->
         atom.workspace.getPanes().length is 2

  waitForPathsToDisplay = (fuzzyFinderView) ->
    waitsFor "paths to display", 5000, ->
      fuzzyFinderView.list.children("li").length > 0

  eachFilePath = (dirPaths, fn) ->
    for dirPath in dirPaths


        bufferView.filterEditorView.getModel().setText('sample.js:4')
        bufferView.populateList()
        waitForPathsToDisplay bufferView

        runs ->
          {filePath} = bufferView.getSelectedItem()
          expect(atom.project.getDirectories()[0].resolve(filePath)).toBe editor1.getPath()

          spyOn(bufferView, 'moveToLine').andCallThrough()
          atom.commands.dispatch bufferView.element, 'core:confirm'

        waitsFor ->
          bufferView.moveToLine.callCount > 0
