Include SpacePen wrapper view in spec

During the transition to React, it will be easier if the EditorComponent
assumes it's rendered inside the ReactEditorView. This will make it
easier to test compatibility with existing editor APIs.
This commit is contained in:
Nathan Sobo 2014-04-10 12:46:58 -06:00
parent 022f5ca219
commit 59709a92ba

View File

@ -1,9 +1,8 @@
React = require 'react'
{extend, flatten, toArray} = require 'underscore-plus'
EditorComponent = require '../src/editor-component'
ReactEditorView = require '../src/react-editor-view'
fdescribe "EditorComponent", ->
[editor, component, node, lineHeightInPixels, charWidth, delayAnimationFrames, nextAnimationFrame] = []
describe "EditorComponent", ->
[editor, wrapperView, component, node, lineHeightInPixels, charWidth, delayAnimationFrames, nextAnimationFrame] = []
beforeEach ->
waitsForPromise ->
@ -19,8 +18,9 @@ fdescribe "EditorComponent", ->
fn()
editor = atom.project.openSync('sample.js')
container = document.querySelector('#jasmine-content')
component = React.renderComponent(EditorComponent({editor}), container)
wrapperView = new ReactEditorView(editor)
wrapperView.attachToDom()
{component} = wrapperView
component.setLineHeight(1.3)
component.setFontSize(20)
{lineHeightInPixels, charWidth} = component.measureLineDimensions()