Skip to content

Instantly share code, notes, and snippets.

@lomse
Created October 11, 2018 00:46
Show Gist options
  • Save lomse/7cc37137c1c6abb15401b85e1f14bc3c to your computer and use it in GitHub Desktop.
Save lomse/7cc37137c1c6abb15401b85e1f14bc3c to your computer and use it in GitHub Desktop.
Snapshot Tests for the TodoForm component
import React from 'react'
import Enzyme, { shallow } from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
import TodoForm from './TodoForm'
describe('TodoForm Component', () => {
beforeAll(() => {
Enzyme.configure({ adapter: new Adapter() })
})
it('renders correctly', () => {
const component = shallow(<TodoForm />)
expect(component).toMatchSnapshot()
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment