Trigger attach before verifying confirm/cancel events

This commit is contained in:
Kevin Sawicki
2013-01-25 12:45:20 -08:00
parent 90d2e12e62
commit 58dbddad53

View File

@@ -36,12 +36,16 @@ describe 'JumpToLine', ->
describe "when no line number has been entered", ->
it "closes the view and does not update the cursor position", ->
editor.trigger 'editor:jump-to-line'
expect(jumpToLine.hasParent()).toBeTruthy()
jumpToLine.miniEditor.trigger 'core:confirm'
expect(jumpToLine.hasParent()).toBeFalsy()
expect(editor.getCursorBufferPosition()).toEqual [1, 0]
describe "when core:cancel is triggered", ->
it "closes the view and does not update the cursor position", ->
editor.trigger 'editor:jump-to-line'
expect(jumpToLine.hasParent()).toBeTruthy()
jumpToLine.miniEditor.trigger 'core:cancel'
expect(jumpToLine.hasParent()).toBeFalsy()
expect(editor.getCursorBufferPosition()).toEqual [1, 0]