From 5e6d91d66c97b6bee49819565a94da4e28e253a9 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 2 May 2014 03:12:17 -0700 Subject: [PATCH] Don't allow spec window size to interfere with the size of the editor --- spec/editor-component-spec.coffee | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/editor-component-spec.coffee b/spec/editor-component-spec.coffee index 18a2b76e0..a92b9e83e 100644 --- a/spec/editor-component-spec.coffee +++ b/spec/editor-component-spec.coffee @@ -3,7 +3,7 @@ ReactEditorView = require '../src/react-editor-view' nbsp = String.fromCharCode(160) describe "EditorComponent", -> - [editor, wrapperView, component, node, verticalScrollbarNode, horizontalScrollbarNode] = [] + [contentNode, editor, wrapperView, component, node, verticalScrollbarNode, horizontalScrollbarNode] = [] [lineHeightInPixels, charWidth, delayAnimationFrames, nextAnimationFrame] = [] beforeEach -> @@ -26,6 +26,9 @@ describe "EditorComponent", -> atom.project.open('sample.js').then (o) -> editor = o runs -> + contentNode = document.querySelector('#jasmine-content') + contentNode.style.width = '1000px' + wrapperView = new ReactEditorView(editor) wrapperView.attachToDom() {component} = wrapperView @@ -38,6 +41,9 @@ describe "EditorComponent", -> verticalScrollbarNode = node.querySelector('.vertical-scrollbar') horizontalScrollbarNode = node.querySelector('.horizontal-scrollbar') + afterEach -> + contentNode.style.width = '' + describe "line rendering", -> it "renders only the currently-visible lines", -> node.style.height = 4.5 * lineHeightInPixels + 'px'