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

describe("Label Component", () => {
  const props: LabelProps = {
    dataTestId: "test-id",
    children: "Label Text",
    className: "custom-label-class",
    editorDisabled: false,
    editorId: "editor-id",
    editorRef: React.createRef(),
    editorValid: true,
    id: "label-id",
    optional: false,
    style: { color: "green" },
  };

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

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