all files / containers/Home/ Home.spec.js

100% Statements 26/26
100% Branches 4/4
100% Functions 4/4
100% Lines 19/19
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27                  
import React from 'react'
import ReactDOM from 'react-dom'
import { createRenderer } from 'react-addons-test-utils'
import $ from 'teaspoon'
import { IntlProvider } from 'react-intl'
 
import Home from './Home'
 
describe('Home', () => {
  const renderer = createRenderer()
  const intlProvider = new IntlProvider({ locale: 'en-US' }, {})
  let $el
  const OriginalHome = Home.getComponent()
  const reactEl = (<IntlProvider><OriginalHome/></IntlProvider>)
 
  beforeEach(() => {
    const { intl } = intlProvider.getChildContext()
    renderer.render(reactEl, { intl })
    $el = $(renderer.getRenderOutput()).render({ intl })
  })
 
  it('should contain "Home"', () => {
    const html = $el.find('section')[0].innerHTML
    expect(html.indexOf('Home')).to.be.above(0)
  })
})