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

describe("Avatar Component", () => {
  const props: AvatarProps = {
    dataTestId: "avatar",
    border: true,
    children: <span>AB</span>,
    className: "custom-avatar-class",
    fillMode: "solid",
    rounded: "medium",
    size: "large",
    style: { backgroundColor: "blue" },
    themeColor: "primary",
    type: "text",
  };

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

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