Skip to content

Commit

Permalink
Added test for Html component.
Browse files Browse the repository at this point in the history
  • Loading branch information
recidive committed Jul 8, 2016
1 parent b89a64b commit c4ab001
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions modules/server/components/Html/__tests__/Html.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
jest.unmock('../Html')
jest.unmock('react-helmet')
jest.unmock('redux-boot')

import React from 'react'
import { shallow, mount, render } from 'enzyme'

import Html from '../Html'
import styles from '../Html.css'

import boot, {BOOT} from 'redux-boot'

describe('Component: Html', () => {

it('should contain a content div', async () => {
const assets = {
styles: {},
javascript: {
main: "/static/bundle.js"
}
}
const {store} = await boot({}, [])
const component = <h1>Hello!</h1>

const props = {
assets,
store,
component
}

const HtmlWrapper = render(<Html {...props} />)
expect(HtmlWrapper.find('h1').text()).toBe('Hello!')
})

})

0 comments on commit c4ab001

Please sign in to comment.