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

describe("RadioButton Component", () => {
  const props: RadioButtonProps = {
    dataTestId: "test-id",
    ariaDescribedBy: "description-id",
    checked: true,
    className: "custom-class",
    disabled: false,
    id: "radio-button-id",
    index: 1,
    label: "Option Label",
    labelPlacement: "after",
    name: "radio-group-name",
    size: "medium",
    style: { color: "blue" },
    tabIndex: 0,
    valid: true,
    value: "option-value",
  };

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

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