         runs ->
           expect(sampleJs).toHaveClass 'selected'
           expect(atom.workspace.getActivePaneItem().getPath()).toBe atom.project.getDirectories()[0].resolve('tree-view.js')
-          expect(treeView.element.querySelector('.tree-view')).toHaveFocus()
+          expect(treeView.list).toMatchSelector(":focus")
 
         waitsForFileToOpen ->
           sampleTxt.dispatchEvent(new MouseEvent('click', {bubbles: true, detail: 1}))

            it 'displays the full contextual menu', ->
              fileView1.dispatchEvent(new MouseEvent('click', {bubbles: true, detail: 1}))
              fileView3.dispatchEvent(new MouseEvent('mousedown', {bubbles: true, ctrlKey: true}))
              expect(treeView.element.querySelector('.tree-view')).toHaveClass('full-menu')
              expect(treeView.element.querySelector('.tree-view')).not.toHaveClass('multi-select')

          describe 'when no item is selected', ->
            it 'selects the ctrl clicked item', ->

              fileView3.dispatchEvent(new MouseEvent('mousedown', {bubbles: true, button: 2}))
              expect(fileView1).toHaveClass('selected')
              expect(fileView3).toHaveClass('selected')
              expect(treeView.list).not.toHaveClass('full-menu')
              expect(treeView.list).toHaveClass('multi-select')

          describe 'when a single item is selected', ->
            it 'displays the full context menu', ->
              fileView1.dispatchEvent(new MouseEvent('click', {bubbles: true, detail: 1}))
              fileView3.dispatchEvent(new MouseEvent('mousedown', {bubbles: true, button: 2}))
              expect(treeView.list).toHaveClass('full-menu')
              expect(treeView.list).not.toHaveClass('multi-select')

            it 'selects right clicked item', ->
              fileView1.dispatchEvent(new MouseEvent('click', {bubbles: true, detail: 1}))
