AddFarmEvent#none() tests

This commit is contained in:
Rick Carlino 2018-05-07 13:35:51 -05:00
parent bfaf7cd066
commit dfc3525874

View file

@ -9,7 +9,7 @@ jest.mock("../../../history", () => ({
}));
import * as React from "react";
import { mount } from "enzyme";
import { mount, shallow } from "enzyme";
import { AddFarmEvent } from "../add_farm_event";
import { AddEditFarmEventProps } from "../../interfaces";
import { fakeFarmEvent, fakeSequence } from "../../../__test_support__/fake_state/resources";
@ -53,6 +53,14 @@ describe("<AddFarmEvent />", () => {
expect(wrapper.text()).toContain("Loading");
});
it("renders `none`", () => {
const props: Partial<AddEditFarmEventProps> = {};
const comp = new AddFarmEvent(props as AddEditFarmEventProps);
const results = shallow(<div>{comp.none()}</div>);
expect(results.text())
.toContain("You haven't made any regimens or sequences yet.");
});
it("cleans up when unmounting", () => {
const props = fakeProps();
const wrapper = mount(<AddFarmEvent {...props} />);