import React from "react"; import { mount } from "enzyme"; import ErrorContainer from "."; describe("", () => { it("renders without error", () => { const wrapper = mount(); expect(wrapper).toExist(); }); it("renders with props", () => { const wrapper = mount( ); expect(wrapper).toExist(); expect(wrapper.prop("headerText")).toEqual("Some error has happened"); expect(wrapper.prop("bodyText")).toEqual("Try again later"); expect(wrapper.prop("buttonText")).toEqual("Go back"); expect(wrapper.prop("buttonUrl")).toEqual("/page"); }); it("accepts id", () => { const wrapper = mount(); expect(wrapper.prop("id")).toEqual("testId"); }); it("accepts className", () => { const wrapper = mount(); expect(wrapper.prop("className")).toEqual("test"); }); it("accepts style", () => { const wrapper = mount(); expect(wrapper.getDOMNode().style).toHaveProperty("color", "red"); }); });