From 1c177aa2068db25de69e333bff6fb4fa52646967 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 2 Jun 2014 17:55:14 +0900 Subject: [PATCH] Add spec for cursor position updates when the font family changes --- spec/editor-component-spec.coffee | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/editor-component-spec.coffee b/spec/editor-component-spec.coffee index da9f5fa5f..1a1d2daa0 100644 --- a/spec/editor-component-spec.coffee +++ b/spec/editor-component-spec.coffee @@ -396,6 +396,14 @@ describe "EditorComponent", -> cursorNode = node.querySelector('.cursor') expect(cursorNode.style['-webkit-transform']).toBe "translate3d(#{10 * editor.getDefaultCharWidth()}px, #{editor.getLineHeightInPixels()}px, 0px)" + it "updates cursor positions when the font family changes", -> + editor.setCursorBufferPosition([1, 10]) + component.setFontFamily('sans-serif') + cursorNode = node.querySelector('.cursor') + + {left} = editor.pixelPositionForScreenPosition([1, 10]) + expect(cursorNode.style['-webkit-transform']).toBe "translate3d(#{left}px, #{editor.getLineHeightInPixels()}px, 0px)" + describe "selection rendering", -> [scrollViewNode, scrollViewClientLeft] = []