<commit_before>React = require 'react'
{extend, flatten, toArray} = require 'underscore-plus'
EditorComponent = require '../src/editor-component'

fdescribe "EditorComponent", ->
  [editor, component, node, lineHeightInPixels, charWidth, delayAnimationFrames, nextAnimationFrame] = []

  beforeEach ->
    waitsForPromise ->
      atom.packages.activatePackage('language-javascript')

    runs ->
      delayAnimationFrames = false
      nextAnimationFrame = null
      spyOn(window, 'requestAnimationFrame').andCallFake (fn) ->
        if delayAnimationFrames
          nextAnimationFrame = fn
        else
          fn()

      editor = atom.project.openSync('sample.js')
      container = document.querySelector('#jasmine-content')
      component = React.renderComponent(EditorComponent({editor}), container)
      component.setLineHeight(1.3)
      component.setFontSize(20)
      {lineHeightInPixels, charWidth} = component.measureLineDimensions()
      node = component.getDOMNode()<commit_msg>Include SpacePen wrapper view in spec<commit_after>{extend, flatten, toArray} = require 'underscore-plus'
ReactEditorView = require '../src/react-editor-view'

describe "EditorComponent", ->
  [editor, wrapperView, component, node, lineHeightInPixels, charWidth, delayAnimationFrames, nextAnimationFrame] = []

  beforeEach ->
    waitsForPromise ->
      atom.packages.activatePackage('language-javascript')

    runs ->
      delayAnimationFrames = false
      nextAnimationFrame = null
      spyOn(window, 'requestAnimationFrame').andCallFake (fn) ->
        if delayAnimationFrames
          nextAnimationFrame = fn
        else
          fn()

      editor = atom.project.openSync('sample.js')
      wrapperView = new ReactEditorView(editor)
      wrapperView.attachToDom()
      {component} = wrapperView
      component.setLineHeight(1.3)
      component.setFontSize(20)
      {lineHeightInPixels, charWidth} = component.measureLineDimensions()
      node = component.getDOMNode()
{'fraction_non_alphanumeric': 0.10513078470824949, 'fraction_numerical': 0.004024144869215292, 'mean_word_length': 3.5935334872979214, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4102742', 'n_tokens_mistral': 541, 'n_tokens_neox': 528, 'n_words': 105}