Fix command panel specs

This commit is contained in:
Corey Johnson
2012-10-23 13:21:14 -07:00
parent ae7264ad12
commit 8f4ec3c45e
2 changed files with 4 additions and 4 deletions

View File

@@ -188,12 +188,12 @@ describe "CommandPanel", ->
describe "when the command panel is not visible", ->
it "shows the command panel and focuses the mini editor, but does not show the preview list", ->
describe "when core:cancel is triggered on the command panel", ->
describe "when tool-pane:unfocus is triggered on the command panel", ->
it "returns focus to the root view but does not hide the command panel", ->
rootView.attachToDom()
commandPanel.attach()
expect(commandPanel.miniEditor.hiddenInput).toMatchSelector ':focus'
commandPanel.trigger 'core:cancel'
commandPanel.trigger 'tool-pane:unfocus'
expect(commandPanel.hasParent()).toBeTruthy()
expect(commandPanel.miniEditor.hiddenInput).not.toMatchSelector ':focus'

View File

@@ -33,7 +33,7 @@ class CommandPanel extends View
commandPanel
@content: (rootView) ->
@div class: 'command-panel', =>
@div class: 'command-panel tool-pane', =>
@subview 'previewList', new PreviewList(rootView)
@div class: 'prompt-and-editor', =>
@div ':', class: 'prompt', outlet: 'prompt'
@@ -50,7 +50,7 @@ class CommandPanel extends View
@history ?= []
@historyIndex = @history.length
@command 'core:cancel', => @rootView.focus()
@command 'tool-pane:unfocus', => @rootView.focus()
@command 'core:close', => @detach()
@command 'core:confirm', => @execute()