2016-12-21 14:06:24 +00:00
|
|
|
/* global it, expect, describe */
|
|
|
|
|
2016-10-26 10:28:41 +00:00
|
|
|
import React from 'react'
|
|
|
|
import { shallow } from 'enzyme'
|
2016-12-21 14:06:24 +00:00
|
|
|
import renderer from 'react-test-renderer'
|
2016-10-26 10:28:41 +00:00
|
|
|
import App from '../pages/index.js'
|
2016-10-26 10:17:02 +00:00
|
|
|
|
2016-12-21 14:06:24 +00:00
|
|
|
describe('With Enzyme', () => {
|
|
|
|
it('App shows "Hello world!"', () => {
|
|
|
|
const app = shallow(
|
|
|
|
<App />
|
|
|
|
)
|
|
|
|
|
|
|
|
expect(app.find('p').text()).toEqual('Hello World!')
|
|
|
|
})
|
|
|
|
})
|
2016-10-26 10:17:02 +00:00
|
|
|
|
2016-12-21 14:06:24 +00:00
|
|
|
describe('With Snapshot Testing', () => {
|
|
|
|
it('App shows "Hello world!"', () => {
|
|
|
|
const component = renderer.create(<App />)
|
|
|
|
const tree = component.toJSON()
|
|
|
|
expect(tree).toMatchSnapshot()
|
|
|
|
})
|
2016-10-26 10:28:41 +00:00
|
|
|
})
|