Created
October 21, 2018 12:07
-
-
Save takethefake/9eb9ecefa169490aa0226a4a826267fe to your computer and use it in GitHub Desktop.
Medium: Enzyme example test
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 * as React from "react"; | |
import ReactDOM from "react-dom"; | |
import { Input } from "../"; | |
test("it initializes with a defaultValue", () => { | |
const defaultValue = "DefaultValue"; | |
const wrapper = mount(<Input initialValue={defaultValue} />); | |
const input = wrapper.find("input"); | |
expect(input.instance().value).toBe(defaultValue); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment