         statusList.focus()
 
       waitsFor 'the highlight to be applied', ->
-        $(workspaceElement).find('git-file-summary-element.selected').length > 0
+        workspaceElement.querySelector('git-file-summary-element.selected')?
 
       runs ->
         atom.commands.dispatch(statusList, 'core:move-right')

      runs ->
        expect(workspaceElement.querySelector('.unstaged.files').innerHTML).toContain('foo.md')

  fdescribe 'keyboard navigation', ->
    it 'focuses a hunk when the status list is focused and the right arrow key is pressed', ->
      makeChange()
      dispatchCommand()


      runs ->
        diffView = document.querySelector('git-diff-view')
        diffView.focus()
        atom.commands.dispatch(diffView, 'core:move-left')

      waitsFor 'the status list view to be focused', ->
        $('git-status-list-view:focus').length > 0

      runs ->
        expect($('git-status-list-view:focus').length).toBe(1)
