   describe "when no element has focus", ->
     it "uses the root view as the element to display and trigger events for", ->
       atom.workspaceView.trigger 'command-palette:toggle'
-      $(':focus').blur()
+      document.activeElement.blur()
       atom.workspaceView.trigger 'command-palette:toggle'
 
       keyBindings = atom.keymap.findKeyBindings(atom.workspaceView.getActiveView())

  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()
      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", ->
