From 6317f9526fbf96b3baaa6cd7727a6d75366f3bc3 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 12 Jun 2012 15:49:49 -0600 Subject: [PATCH] :lipstick: --- spec/app/editor-spec.coffee | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index cace22dc3..7779b086c 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -1210,22 +1210,18 @@ describe "Editor", -> editor.setCursorScreenPosition([2, 5]) expect(editor.scrollView.scrollLeft()).toBe 0 - describe "buffer manipulation", -> - beforeEach -> + describe "when text input events are triggered on the hidden input element", -> + it "inserts the typed character at the cursor position, both in the buffer and the pre element", -> editor.attachToDom() + editor.setCursorScreenPosition(row: 1, column: 6) - describe "when text input events are triggered on the hidden input element", -> - describe "when there is no selection", -> - it "inserts the typed character at the cursor position, both in the buffer and the pre element", -> - editor.setCursorScreenPosition(row: 1, column: 6) + expect(buffer.lineForRow(1).charAt(6)).not.toBe 'q' - expect(buffer.lineForRow(1).charAt(6)).not.toBe 'q' + editor.hiddenInput.textInput 'q' - editor.hiddenInput.textInput 'q' - - expect(buffer.lineForRow(1).charAt(6)).toBe 'q' - expect(editor.getCursorScreenPosition()).toEqual(row: 1, column: 7) - expect(editor.renderedLines.find('.line:eq(1)')).toHaveText buffer.lineForRow(1) + expect(buffer.lineForRow(1).charAt(6)).toBe 'q' + expect(editor.getCursorScreenPosition()).toEqual(row: 1, column: 7) + expect(editor.renderedLines.find('.line:eq(1)')).toHaveText buffer.lineForRow(1) describe "when the editor is attached to the dom", -> it "calculates line height and char width and updates the pixel position of the cursor", ->