import { render } from "@testing-library/react";

import { Skeleton } from "../Skeleton";

describe("rendering Skeleton", () => {
  describe("initial state", () => {
    it("has default className skeleton", () => {
      const { getByTestId } = render(<Skeleton data-testid="test-id" />);
      expect(getByTestId("test-id")).toHaveClass("skeleton");
    });
  });

  describe("passed props", () => {
    it("has additional class when className is set ", () => {
      const { getByTestId } = render(
        <Skeleton data-testid="test-id" className="test-class" />,
      );
      expect(getByTestId("test-id")).toHaveClass("skeleton");
      expect(getByTestId("test-id")).toHaveClass("test-class");
    });
  });
});
