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

describe("Skeleton Component", () => {
  const props: SkeletonProps = {
    dataTestId: "test-id",
    animation: { type: "pulse" },
    className: "custom-skeleton-class",
    shape: "text",
    style: { backgroundColor: "grey" },
  };

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

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