 
   describe "when project-find:toggle is triggered", ->
     it "toggles the visibility of the ProjectFindView", ->
-      atom.workspaceView.trigger 'project-find:toggle'
+      atom.commands.dispatch(workspaceElement, 'project-find:toggle')
 
       waitsForPromise ->
         activationPromise
 
       runs ->
         expect(getAtomPanel()).toBeVisible()
-        atom.workspaceView.trigger 'project-find:toggle'
+        atom.commands.dispatch(workspaceElement, 'project-find:toggle')
         expect(getAtomPanel()).not.toBeVisible()
 
   describe "when project-find:show-in-current-directory is triggered", ->

          called = true
          deferred.promise

        projectFindView.trigger 'project-find:replace-all'

        waitsFor -> called


          projectFindView.replaceEditor.setText('ok')
          expect(projectFindView.resultsView).not.toBeVisible()

          atom.commands.dispatch(projectFindView[0], 'project-find:replace-all')

          waitsForPromise ->
            replacePromise
