Skip to content

Instantly share code, notes, and snippets.

@takethefake
Created October 21, 2018 12:07
Show Gist options
  • Save takethefake/9eb9ecefa169490aa0226a4a826267fe to your computer and use it in GitHub Desktop.
Save takethefake/9eb9ecefa169490aa0226a4a826267fe to your computer and use it in GitHub Desktop.
Medium: Enzyme example test
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