From 2a2750862acc23e845784db22b313dcbd76394fb Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 25 Sep 2013 16:24:51 -0700 Subject: [PATCH] Add failing spec --- spec/editor-spec.coffee | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/editor-spec.coffee b/spec/editor-spec.coffee index 797f63d62..3890f1448 100644 --- a/spec/editor-spec.coffee +++ b/spec/editor-spec.coffee @@ -63,6 +63,15 @@ describe "Editor", -> expect(editor).not.toMatchSelector ':focus' expect(editor.hiddenInput).toMatchSelector ':focus' + it "does not scroll the editor (regression)", -> + editor.attachToDom(heightInLines: 2) + editor.selectAll() + editor.hiddenInput.blur() + editor.focus() + + expect(editor.hiddenInput).toMatchSelector ':focus' + expect($(editor[0]).scrollTop()).toBe 0 + describe "when the hidden input is focused / unfocused", -> it "assigns the isFocused flag on the editor and also adds/removes the .focused css class", -> editor.attachToDom()