From 025370b9f88085162f2d61a625cf09b24e34f0bf Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Thu, 12 Jun 2014 16:17:18 -0700 Subject: [PATCH] Add editor component resize spec --- 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 8baea2607..dbc0ed296 100644 --- a/spec/editor-component-spec.coffee +++ b/spec/editor-component-spec.coffee @@ -1265,6 +1265,14 @@ describe "EditorComponent", -> wrapperView.show() expect(node.querySelector('.cursor').style['-webkit-transform']).toBe "translate3d(#{9 * charWidth}px, 0px, 0px)" + describe "when the editor component is resized", -> + it "updates the size in the editor model", -> + originalHeight = editor.getHeight() + fourLinesHeight = 4 * editor.getLineHeightInPixels() + node.style.height = "#{originalHeight - fourLinesHeight}px" + component.forceUpdate() + expect(editor.getHeight()).not.toBe originalHeight + buildMouseEvent = (type, properties...) -> properties = extend({bubbles: true, cancelable: true}, properties...) event = new MouseEvent(type, properties)