             jasmine.attachToDOM(treeView.element)
             atom.commands.dispatch copyDialog.element, 'core:cancel'
             expect(atom.workspace.getModalPanels().length).toBe 0
-            expect(treeView.find(".tree-view")).toHaveFocus()
+            expect(treeView.querySelector(".tree-view")).toHaveFocus()
 
         describe "when the duplicate dialog's editor loses focus", ->
           it "removes the dialog and focuses root view", ->

        treeView.detach()
        atom.commands.dispatch(workspaceElement, 'tree-view:toggle')
        expect(treeView.hasParent()).toBeTruthy()
        expect(treeView.element.querySelector('.tree-view')).toHaveFocus()

    describe "when tree-view:toggle-side is triggered on the root view", ->
      describe "when the tree view is on the left", ->

    it "restores the focus state of the tree view", ->
      jasmine.attachToDOM(workspaceElement)
      treeView.focus()
      expect(treeView.list).toMatchSelector(":focus")
      atom.packages.deactivatePackage("tree-view")

      waitsForPromise ->
