From 14e5dde41806de3697090919f0164253bbab6867 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 26 Dec 2012 10:53:02 -0800 Subject: [PATCH] Create custom jQuery event for shift select on gutter --- spec/app/editor-spec.coffee | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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]]