Add spec coverage for command panel serialization and fix bad method call therein

This commit is contained in:
Nathan Sobo
2012-06-13 21:23:33 -06:00
parent b59e73edcd
commit 47533ad3a0
2 changed files with 11 additions and 1 deletions

View File

@@ -10,6 +10,16 @@ describe "CommandPanel", ->
rootView.enableKeymap()
commandPanel = rootView.activateExtension(CommandPanel)
describe "serialization", ->
it "preserves the command panel's mini editor text and visibility across reloads", ->
rootView.trigger 'command-panel:toggle'
commandPanel.miniEditor.insertText 'abc'
newRootView = RootView.deserialize(rootView.serialize())
commandPanel = newRootView.activateExtension(CommandPanel)
expect(newRootView.find('.command-panel')).toExist()
expect(commandPanel.miniEditor.getText()).toBe 'abc'
describe "when toggle-command-panel is triggered on the root view", ->
it "toggles the command panel", ->
rootView.attachToDom()