     it "highlights an exact match", ->
       bufferView.filterEditorView.getModel().setText('sample.js')
       bufferView.populateList()
-      resultView = bufferView.getSelectedItemView()
-
-      primaryMatches = resultView.find('.primary-line .character-match')
-      secondaryMatches = resultView.find('.secondary-line .character-match')
-      expect(primaryMatches.length).toBe 1
-      expect(primaryMatches.last().text()).toBe 'sample.js'
-      # Use `toBeGreaterThan` because dir may have some characters in it
-      expect(secondaryMatches.length).toBeGreaterThan 0
-      expect(secondaryMatches.last().text()).toBe 'sample.js'
+
+      waitForPathsToDisplay bufferView
+      runs ->
+        resultView = bufferView.getSelectedItemView()
+
+        primaryMatches = resultView.find('.primary-line .character-match')
+        secondaryMatches = resultView.find('.secondary-line .character-match')
+        expect(primaryMatches.length).toBe 1
+        expect(primaryMatches.last().text()).toBe 'sample.js'
+        # Use `toBeGreaterThan` because dir may have some characters in it
+        expect(secondaryMatches.length).toBeGreaterThan 0
+        expect(secondaryMatches.last().text()).toBe 'sample.js'
 
     it "highlights a partial match", ->
       bufferView.filterEditorView.getModel().setText('sample')
       bufferView.populateList()
-      resultView = bufferView.getSelectedItemView()
-
-      primaryMatches = resultView.find('.primary-line .character-match')
-      secondaryMatches = resultView.find('.secondary-line .character-match')
-      expect(primaryMatches.length).toBe 1
-      expect(primaryMatches.last().text()).toBe 'sample'
-      # Use `toBeGreaterThan` because dir may have some characters in it
-      expect(secondaryMatches.length).toBeGreaterThan 0
-      expect(secondaryMatches.last().text()).toBe 'sample'
+
+      waitForPathsToDisplay bufferView
+      runs ->
+        resultView = bufferView.getSelectedItemView()
+
+        primaryMatches = resultView.find('.primary-line .character-match')
+        secondaryMatches = resultView.find('.secondary-line .character-match')
+        expect(primaryMatches.length).toBe 1
+        expect(primaryMatches.last().text()).toBe 'sample'
+        # Use `toBeGreaterThan` because dir may have some characters in it
+        expect(secondaryMatches.length).toBeGreaterThan 0
+        expect(secondaryMatches.last().text()).toBe 'sample'
 
     it "highlights multiple matches in the file name", ->
       bufferView.filterEditorView.getModel().setText('samplejs')
       bufferView.populateList()
-      resultView = bufferView.getSelectedItemView()
-
-      primaryMatches = resultView.find('.primary-line .character-match')
-      secondaryMatches = resultView.find('.secondary-line .character-match')
-      expect(primaryMatches.length).toBe 2
-      expect(primaryMatches.first().text()).toBe 'sample'
-      expect(primaryMatches.last().text()).toBe 'js'
-      # Use `toBeGreaterThan` because dir may have some characters in it
-      expect(secondaryMatches.length).toBeGreaterThan 1
-      expect(secondaryMatches.last().text()).toBe 'js'
+
+      waitForPathsToDisplay bufferView
+      runs ->
+        resultView = bufferView.getSelectedItemView()
+
+        primaryMatches = resultView.find('.primary-line .character-match')
+        secondaryMatches = resultView.find('.secondary-line .character-match')
+        expect(primaryMatches.length).toBe 2
+        expect(primaryMatches.first().text()).toBe 'sample'
+        expect(primaryMatches.last().text()).toBe 'js'
+        # Use `toBeGreaterThan` because dir may have some characters in it
+        expect(secondaryMatches.length).toBeGreaterThan 1
+        expect(secondaryMatches.last().text()).toBe 'js'
 
     it "highlights matches in the directory and file name", ->
       bufferView.items = [

      pane = atom.workspace.getActivePane()

      dispatchCommand('toggle-buffer-finder')
      {filePath} = bufferView.getSelectedItem()
      atom.commands.dispatch bufferView.filterEditorView.element, 'pane:split-down'

      waitsFor ->
        atom.workspace.getPanes().length is 2

          originalText = editor.getText()
          originalPath = editor.getPath()
          fs.writeFileSync(originalPath, 'making a change for the better')

        waitsForPromise ->
          gitRepository.refreshStatusForPath(originalPath)

        runs ->
          newPath = atom.project.getDirectories()[1].resolve('newsample.js')
          fs.writeFileSync(newPath, '')

        waitsForPromise ->
          gitRepository.refreshStatusForPath(newPath)

      it "displays all new and modified paths", ->
        expect(atom.workspace.panelForItem(gitStatusView)).toBeNull()
        dispatchCommand('toggle-git-status-finder')
        expect(atom.workspace.panelForItem(gitStatusView).isVisible()).toBe true

        waitForPathsToDisplay gitStatusView

        runs ->
          expect(gitStatusView.find('.status.status-modified').length).toBe 1
          expect(gitStatusView.find('.status.status-added').length).toBe 3

    describe "status decorations", ->
      [originalText, originalPath, editor, newPath] = []
