   describe "when the body has focus", ->
     it "uses the root view as the element to display and trigger events for", ->
       atom.workspaceView.trigger 'command-palette:toggle'
-      $(document.body).focus()
+      document.body.focus()
       atom.workspaceView.trigger 'command-palette:toggle'
       keyBindings = atom.keymap.findKeyBindings(atom.workspaceView.getActiveView())
       for {name, displayName} in atom.commands.findCommands(target: atom.workspaceView[0])

_ = require 'underscore-plus'
{$, WorkspaceView} = require 'atom'
CommandPalette = require '../lib/command-palette-view'

describe "CommandPalette", ->

        for binding in keyBindings when binding.command == name
          expect(eventLi.find(".key-binding:contains(#{_.humanizeKeystroke(binding.keystrokes)})")).toExist()

    it "focuses the mini-editor and selects the first command", ->
      expect(palette.filterEditorView.hasFocus()).toBeTruthy()
      expect(palette.find('.event:first')).toHaveClass 'selected'
