From 6108c04f40fca5fc212629897e69fa9c78fc15a2 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 28 Jan 2015 17:24:36 -0700 Subject: [PATCH] =?UTF-8?q?Add=20spec=20coverage=20for=20deprecated=20?= =?UTF-8?q?=E2=80=98cursor:moved=E2=80=99=20event?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So we don’t accidentally drop it during this transition --- spec/text-editor-component-spec.coffee | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/text-editor-component-spec.coffee b/spec/text-editor-component-spec.coffee index 6b1cb3953..12847bbba 100644 --- a/spec/text-editor-component-spec.coffee +++ b/spec/text-editor-component-spec.coffee @@ -656,7 +656,7 @@ describe "TextEditorComponent", -> expect(lineNumberHasClass(1, 'folded')).toBe false describe "cursor rendering", -> - it "renders the currently visible cursors, translated relative to the scroll position", -> + it "renders the currently visible cursors", -> cursor1 = editor.getLastCursor() cursor1.setScreenPosition([0, 5]) @@ -693,9 +693,16 @@ describe "TextEditorComponent", -> expect(cursorNodes[0].style['-webkit-transform']).toBe "translate(#{11 * charWidth}px, #{8 * lineHeightInPixels}px)" expect(cursorNodes[1].style['-webkit-transform']).toBe "translate(#{10 * charWidth}px, #{4 * lineHeightInPixels}px)" + wrapperView.on 'cursor:moved', cursorMovedListener = jasmine.createSpy('cursorMovedListener') + cursor3.setScreenPosition([4, 11], autoscroll: false) + nextAnimationFrame() + expect(cursorNodes[1].style['-webkit-transform']).toBe "translate(#{11 * charWidth}px, #{4 * lineHeightInPixels}px)" + expect(cursorMovedListener).toHaveBeenCalled() + cursor3.destroy() nextAnimationFrame() cursorNodes = componentNode.querySelectorAll('.cursor') + expect(cursorNodes.length).toBe 1 expect(cursorNodes[0].style['-webkit-transform']).toBe "translate(#{11 * charWidth}px, #{8 * lineHeightInPixels}px)"