<commit_before><commit_msg>specs for smart-overflow<commit_after>React = require 'react'
{Testing, expect, sinon, _} = require 'test/helpers'

SmartOverflow = require 'components/smart-overflow'

TestChildComponent = React.createClass
  render: -> React.createElement('span', {}, 'i am a test')

describe 'SmartOverflow Component', ->

  beforeEach ->
    @props =
      className: 'testing'
      children: React.createElement(TestChildComponent)

  it 'renders with className', ->
    Testing.renderComponent( SmartOverflow, props: @props ).then ({dom}) ->
      expect(dom.classList.contains('testing')).to.be.true
      expect(dom.classList.contains('openstax-smart-overflow')).to.be.true

  it 'renders child components', ->
    Testing.renderComponent( SmartOverflow, props: @props ).then ({dom}) ->
      expect(dom.textContent).equal('i am a test')
{'fraction_non_alphanumeric': 0.14485981308411214, 'fraction_numerical': 0.0, 'mean_word_length': 4.424050632911392, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '7547073', 'n_tokens_mistral': 248, 'n_tokens_neox': 245, 'n_words': 56}