Change spec to test disabling and enabling keymaps after activation

This commit is contained in:
Tom Munro
2015-07-29 09:28:37 -07:00
parent b6b81fc2ed
commit 90ec8df3e6

View File

@@ -452,18 +452,17 @@ describe "PackageManager", ->
runs ->
expect(atom.keymaps.findKeyBindings(keystrokes: 'ctrl-z', target: element1[0])).toHaveLength 0
describe "when the package's keymaps are disabled at activation and re-enabled later", ->
it "re-adds the keymaps", ->
describe "when the package's keymaps are disabled and re-enabled after it is activated", ->
it "removes and re-adds the keymaps", ->
element1 = $$ -> @div class: 'test-1'
expect(atom.keymaps.findKeyBindings(keystrokes: 'ctrl-z', target: element1[0])).toHaveLength 0
atom.config.set("core.disabledKeymaps", ["package-with-keymaps-manifest"])
waitsForPromise ->
atom.packages.activatePackage("package-with-keymaps-manifest")
runs ->
atom.config.set("core.disabledKeymaps", ['package-with-keymaps-manifest'])
expect(atom.keymaps.findKeyBindings(keystrokes: 'ctrl-z', target: element1[0])).toHaveLength 0
atom.config.set("core.disabledKeymaps", [])
expect(atom.keymaps.findKeyBindings(keystrokes: 'ctrl-z', target: element1[0])[0].command).toBe 'keymap-1'