import React from "react";
import { render } from "@testing-library/react";
import "@testing-library/jest-dom";
import Icon from "../Icon";
import { IconProps } from "../IconProps";

describe("Icon Component", () => {
  const props: IconProps = {
    dataTestId: "test-id",
    className: "icon-class",
    flip: "horizontal",
    id: "icon-id",
    name: "home",
    size: "medium",
    style: { color: "red" },
    tabIndex: 0,
    themeColor: "primary",
  };

  it("renders all props correctly", () => {
    render(<Icon {...props} />);
  });

  it("matches the snapshot", () => {
    const { asFragment } = render(<Icon {...props} />);
    expect(asFragment()).toMatchSnapshot();
  });
});
