 
       describe "when the metadata contains a 'menus' manifest", ->
         it "loads only the menus specified by the manifest, in the specified order", ->
-          element = ($$ -> @div class: 'test-1')[0]
+          element = createTestElement('test-1')
 
           expect(atom.contextMenu.templateForElement(element)).toEqual []
 


      describe "when the metadata does not contain a 'menus' manifest", ->
        it "loads all the .cson/.json files in the menus directory", ->
          element = ($$ -> @div class: 'test-1')[0]

          expect(atom.contextMenu.templateForElement(element)).toEqual []


            atom.packages.activatePackage("package-with-keymaps-manifest")

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

      describe "when the package's keymaps are disabled and re-enabled after it is activated", ->
        it "removes and re-adds the keymaps", ->
          element1 = createTestElement('test-1')
          atom.packages.observePackagesWithKeymapsDisabled()

          waitsForPromise ->
