           mainModule.createViews()
           {projectFindView} = mainModule
 
-        editorView.trigger 'project-find:show'
+        atom.commands.dispatch editorView[0], 'project-find:show'
 
         waitsForPromise ->
           activationPromise

    describe "when find-and-replace:set-find-pattern is triggered", ->
      it "places the selected text into the find editor", ->
        editorView.getModel().setSelectedBufferRange([[1,6],[1,10]])
        atom.workspaceView.trigger 'find-and-replace:use-selection-as-find-pattern'
        expect(projectFindView.findEditor.getText()).toBe 'sort'

        editorView.getModel().setSelectedBufferRange([[1,13],[1,21]])
        atom.workspaceView.trigger 'find-and-replace:use-selection-as-find-pattern'
        expect(projectFindView.findEditor.getText()).toBe 'function'

      it "places the previously selected text into the find editor if no selection", ->
        editorView.getModel().setSelectedBufferRange([[1,13],[1,21]])
        atom.workspaceView.trigger 'find-and-replace:use-selection-as-find-pattern'
        expect(projectFindView.findEditor.getText()).toBe 'function'

        editorView.getModel().setSelectedBufferRange([[1,30],[1,30]])
        atom.workspaceView.trigger 'find-and-replace:use-selection-as-find-pattern'
        expect(projectFindView.findEditor.getText()).toBe ''

    describe "when there is an error searching", ->

        projectFindView.focus()

      it "detaches from the root view", ->
        atom.commands.dispatch(document.activeElement, 'core:cancel')
        expect(getAtomPanel()).not.toBeVisible()

    describe "splitting into a second pane", ->
      beforeEach ->
        atom.workspaceView.height(1000)
        atom.commands.dispatch editorView[0], 'project-find:show'

      it "splits when option is true", ->
        initialPane = atom.workspaceView.getActivePaneView()
