import React from "react"; import { mount } from "enzyme"; import Backdrop from "."; const baseProps = { visible: false, }; describe("", () => { it("renders without error", () => { const wrapper = mount(); expect(wrapper).toExist(); }); it("visible", () => { const wrapper = mount(); expect(wrapper.prop("visible")).toBe(true); }); it("accepts id", () => { const wrapper = mount(); expect(wrapper.prop("id")).toEqual("testId"); }); it("accepts className string", () => { const wrapper = mount(); expect(wrapper.prop("className")).toEqual("test"); }); it("accepts className array", () => { const testArr = ["test", "backdrop-active"]; const wrapper = mount(); expect(wrapper.prop("className")).toEqual(expect.arrayContaining(testArr)); }); it("accepts style", () => { const wrapper = mount( ); expect(wrapper.getDOMNode().style).toHaveProperty("color", "red"); }); });