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

          expect(sampleTxt).toHaveClass 'selected'
          expect(treeView.element.querySelectorAll('.selected').length).toBe 1
          expect(atom.workspace.getActivePaneItem().getPath()).toBe atom.project.getDirectories()[0].resolve('tree-view.txt')
          expect(treeView.element.querySelector('.tree-view')).toHaveFocus()

    describe "opening existing opened files in existing split panes", ->
      beforeEach ->

            expect(treeView).toBeVisible()
            atom.commands.dispatch(workspaceElement, 'tree-view:toggle-focus')
            expect(treeView).toBeVisible()
            expect(treeView.list).not.toMatchSelector(":focus")

  describe "when tree-view:reveal-active-file is triggered on the root view", ->
    beforeEach ->
