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

describe("Loader Component", () => {
  const props: LoaderProps = {
    dataTestId: "test-id",
    className: "custom-loader-class",
    size: "medium",
    style: { color: "red" },
    themeColor: "primary",
    type: "pulsing",
  };

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

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