diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index 1ee20fa91..08fb14cd4 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -1992,13 +1992,17 @@ describe "Editor", -> expect(editor.getText()).toBe(originalPathText) describe "when clicking a gutter line", -> - it "moves the cursor to the start of the selected line", -> + beforeEach -> rootView.attachToDom() + + it "moves the cursor to the start of the selected line", -> expect(editor.getCursorScreenPosition()).toEqual [0,0] editor.gutter.find(".line-number:eq(1)").trigger 'click' expect(editor.getCursorScreenPosition()).toEqual [1,0] it "selects to the start of the selected line when shift is pressed", -> - expect(editor.getSelection().getScreenRange()).toEqual [0,0], [0,0] - editor.gutter.find(".line-number:eq(1)").trigger 'click', {shiftKey: true} - expect(editor.getSelection().getScreenRange()).toEqual [0,0], [1,0] + expect(editor.getSelection().getScreenRange()).toEqual [[0,0], [0,0]] + event = $.Event("click") + event.shiftKey = true + editor.gutter.find(".line-number:eq(1)").trigger event + expect(editor.getSelection().getScreenRange()).toEqual [[0,0], [1,0]]