         findView.findEditor.setText('')
 
         editor.setSelectedBufferRange([[2, 14], [2, 20]])
-        editorView.trigger 'find-and-replace:show'
+        atom.commands.dispatch editorView, 'find-and-replace:show'
         expect(getFindAtomPanel()).toBeVisible()
         expect(findView.findEditor.getText()).toBe('length')
 
     it "does not change the findEditor text when there is no selection", ->
       editor.setSelectedBufferRange([[2, 8], [2, 8]])
-      editorView.trigger 'find-and-replace:show'
+      atom.commands.dispatch editorView, 'find-and-replace:show'
 
       waitsForPromise ->
         activationPromise
 
       runs ->
         findView.findEditor.setText 'kitten'
-        editorView.trigger 'find-and-replace:show'
+        atom.commands.dispatch editorView, 'find-and-replace:show'
         expect(findView.findEditor.getText()).toBe('kitten')
 
     it "does not change the findEditor text when there is a multiline selection", ->
       editor.setSelectedBufferRange([[2, 8], [3, 12]])
-      editorView.trigger 'find-and-replace:show'
+      atom.commands.dispatch editorView, 'find-and-replace:show'
 
       waitsForPromise ->
         activationPromise


    it "populates the findEditor with selection when there is a selection", ->
      editor.setSelectedBufferRange([[2, 8], [2, 13]])
      editorView.trigger 'find-and-replace:show'

      waitsForPromise ->
        activationPromise

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

        it "initially highlights the found text in the new edit session", ->
          expect(getResultDecorations(editor, 'find-result')).toHaveLength 6

          waitsForPromise ->
            atom.workspace.open('sample.coffee')

          runs ->
            # old editor has no more results
            expect(getResultDecorations(editor, 'find-result')).toHaveLength 0

            # new one has 7 results
            newEditor = atom.workspace.getActiveEditor()
            expect(getResultDecorations(newEditor, 'find-result')).toHaveLength 7

        it "highlights the found text in the new edit session when find next is triggered", ->
          waitsForPromise ->
