2017-05-09 16:00:25 +00:00
|
|
|
/* eslint-env jest */
|
2016-12-21 14:06:24 +00:00
|
|
|
|
2016-10-26 10:28:41 +00:00
|
|
|
import { shallow } from 'enzyme'
|
2017-05-09 16:00:25 +00:00
|
|
|
import React from 'react'
|
2016-12-21 14:06:24 +00:00
|
|
|
import renderer from 'react-test-renderer'
|
2017-05-09 16:00:25 +00:00
|
|
|
|
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!"', () => {
|
2017-05-09 16:00:25 +00:00
|
|
|
const app = shallow(<App />)
|
2016-12-21 14:06:24 +00:00
|
|
|
|
|
|
|
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
|
|
|
})
|