Hide the loading message when eval throws an error

This commit is contained in:
Kevin Sawicki
2013-03-27 15:41:26 -04:00
parent 7f8adf247e
commit b6334483c9
2 changed files with 4 additions and 1 deletions

View File

@@ -141,6 +141,7 @@ class CommandPanelView extends View
else
@detach()
catch error
@loadingMessage.hide()
if error.name is "SyntaxError"
@flashError()
return

View File

@@ -345,13 +345,15 @@ describe "CommandPanel", ->
# there shouldn't be any dangling operations after this
describe "if the command is malformed", ->
it "adds and removes an error class to the command panel and does not close it", ->
it "adds and removes an error class to the command panel and does not close it or display a loading message", ->
rootView.attachToDom()
rootView.trigger 'command-panel:toggle'
commandPanel.miniEditor.insertText 'garbage-command!!'
commandPanel.miniEditor.hiddenInput.trigger keydownEvent('enter')
expect(commandPanel.parent()).toExist()
expect(commandPanel).toHaveClass 'error'
expect(commandPanel.loadingMessage).toBeHidden()
advanceClock 400