Last active
October 20, 2018 15:10
-
-
Save lomse/ee9e4f4fafb8ee561c58a618edafb5e3 to your computer and use it in GitHub Desktop.
Snapshot test for TodoItem component with Enzyme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react" | |
import Enzyme, { shallow } from "enzyme" | |
import Adapter from "enzyme-adapter-react-16" | |
import TodoItem from "./TodoItem" | |
describe("TodoItem Component", () => { | |
beforeAll(() => { | |
Enzyme.configure({ adapter: new Adapter() }) | |
}) | |
it("renders correctly", () => { | |
const component = shallow(<TodoItem id={1} title="Do house chores" />) | |
expect(component).toMatchSnapshot() | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment