mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Change spec to test disabling and enabling keymaps after activation
This commit is contained in:
@@ -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'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user