Skip to content

Instantly share code, notes, and snippets.

@kenwheeler
Last active February 8, 2016 15:29
Show Gist options
  • Save kenwheeler/eab91734e662d7483c8b to your computer and use it in GitHub Desktop.
Save kenwheeler/eab91734e662d7483c8b to your computer and use it in GitHub Desktop.
import React from "react";
import { shallow } from "enzyme";
import OurComponent from "../our-component";
describe("<OurComponent/>", () => {
it("should render children when supplied the items prop", () => {
let mockData = [
{ name: "test" },
{ name: "test" }
];
let wrapper = shallow(<OurComponent items={mockData}/>);
let items = wrapper.findWhere((component) => {
return component.props().children === "test";
});
expect(items.length).to.equal(2);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment