           expect(newEditorView.getEditor().getSelectedBufferRange()).toEqual [[1, 9], [1, 14]]
 
         it "highlights the found text in the new edit session (and removes the highlights from the other)", ->
-          findResultsView = editorView.find('.search-results')
-
-          expect(findResultsView.children()).toHaveLength 6
-          editorView.getPane().splitRight(atom.project.openSync('sample.coffee'))
-          expect(findResultsView.children()).toHaveLength 7
+          newEditorView = editorView.getPane().splitRight(atom.project.openSync('sample.coffee'))
+
+          waits 1
+          runs ->
+            # old editor has no more results
+            expect(editorView.find('.find-result')).toHaveLength 0
+
+            # new one has 7 results
+            expect(newEditorView.find('.find-result')).toHaveLength 7
 
         it "will still highlight results after the split pane has been destroyed", ->
-          findResultsView = editorView.find('.search-results')
-          expect(findResultsView.children()).toHaveLength 6
-
           newEditorView = editorView.getPane().splitRight(atom.project.openSync('sample.coffee'))
-          expect(findResultsView.children()).toHaveLength 7
+          expect(newEditorView.find('.find-result')).toHaveLength 7
 
           newEditorView.focus()
           newEditorView.trigger('core:close')
           editorView.focus()
-          expect(findResultsView.children()).toHaveLength 6
+
+          waits 1
+          runs ->
+            expect(editorView.find('.find-result')).toHaveLength 6
 
     describe "when the buffer contents change", ->
       it "re-runs the search", ->

          expect(editor.getSelectedBufferRange()).toEqual [[0, 0], [0, 0]]

        it "initially highlights the found text in the new edit session", ->
          findResultsView = editorView.find('.search-results')

          atom.workspaceView.openSync('sample.coffee')
          expect(findResultsView.children()).toHaveLength 7

        it "highlights the found text in the new edit session when find next is triggered", ->
          findResultsView = editorView.find('.search-results')
          atom.workspaceView.openSync('sample.coffee')
          editorView = atom.workspaceView.getActiveView()

          findView.findEditor.trigger 'find-and-replace:find-next'
          expect(findResultsView.children()).toHaveLength 7
          expect(findResultsView.parent()[0]).toBe editorView.underlayer[0]

      describe "when all active pane items are closed", ->
        it "updates the result count", ->
          editorView.trigger 'core:close'
          expect(findView.resultCounter.text()).toEqual('no results')

        it "removes all highlights", ->
          findResultsView = editorView.find('.search-results')

          editorView.trigger 'core:close'
          expect(findResultsView.children()).toHaveLength 0

      describe "when the active pane item is not an edit session", ->
        [anotherOpener] = []


          expect(findResultsView.children()).toHaveLength 0

      describe "when a new edit session is activated on a different pane", ->
        it "initially highlights all the sample.js results", ->
          expect(editorView.find('.find-result')).toHaveLength 6

        it "reruns the search on the new editSession", ->
          newEditorView = editorView.getPane().splitRight(atom.project.openSync('sample.coffee')).activeView
          expect(findView.resultCounter.text()).toEqual('7 found')
