import React from "react"; import renderer from "react-test-renderer"; import { AttentionBoxType } from "../AttentionBoxConstants"; import Icon from "../../Icon/Icon"; import AttentionBox from "../AttentionBox"; describe("AttentionBox renders correctly", () => { it("renders correctly", () => { const tree = renderer.create().toJSON(); expect(tree).toMatchSnapshot(); }); it("renders correctly with empty props", () => { const tree = renderer.create().toJSON(); expect(tree).toMatchSnapshot(); }); it("renders correctly with empty title prop", () => { const tree = renderer.create().toJSON(); expect(tree).toMatchSnapshot(); }); it("renders correctly with no icon", () => { const tree = renderer.create().toJSON(); expect(tree).toMatchSnapshot(); }); it("renders correctly when compact", () => { const tree = renderer.create().toJSON(); expect(tree).toMatchSnapshot(); }); it("renders correctly dark type", () => { const tree = renderer.create().toJSON(); expect(tree).toMatchSnapshot(); }); it("renders with icon font type", () => { const tree = renderer .create() .toJSON(); expect(tree).toMatchSnapshot(); }); it("renders correctly className", () => { const tree = renderer.create().toJSON(); expect(tree).toMatchSnapshot(); }); it("renders correctly with onClose", () => { const tree = renderer.create( {}} />).toJSON(); expect(tree).toMatchSnapshot(); }); it("renders correctly with renderer", () => { const tree = renderer .create( renderer with components
and sub components
) .toJSON(); expect(tree).toMatchSnapshot(); }); });