Add editor component resize spec

This commit is contained in:
Corey Johnson
2014-06-12 16:17:18 -07:00
parent 4186a4943b
commit 025370b9f8

View File

@@ -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)