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'