 path = require 'path'
-{$, $$} = require '../src/space-pen-extensions'
 Package = require '../src/package'
 {Disposable} = require 'atom'
 
 describe "PackageManager", ->
   workspaceElement = null
+
+  createTestElement = (className) ->
+    element = document.createElement('div')
+    element.className = className
+    element
 
   beforeEach ->
     workspaceElement = atom.views.getView(atom.workspace)


      describe "when the package's keymaps have been disabled", ->
        it "does not add the keymaps", ->
          element1 = $$ -> @div class: 'test-1'

          expect(atom.keymaps.findKeyBindings(keystrokes: 'ctrl-z', target: element1[0])).toHaveLength 0

          atom.config.set("core.packagesWithKeymapsDisabled", ["package-with-keymaps-manifest"])



          runs ->
            atom.config.set("core.packagesWithKeymapsDisabled", ['package-with-keymaps-manifest'])
            expect(atom.keymaps.findKeyBindings(keystrokes: 'ctrl-z', target: element1)).toHaveLength 0

            atom.config.set("core.packagesWithKeymapsDisabled", [])
            expect(atom.keymaps.findKeyBindings(keystrokes: 'ctrl-z', target: element1)[0].command).toBe 'keymap-1'

    describe "menu loading", ->
      beforeEach ->
