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

const CustomComponent: React.FunctionComponent = () => <div></div>;

describe("TextBox Component", () => {
  const props: TextBoxProps = {
    fillMode: "solid",
    prefix: CustomComponent,
    rounded: "medium",
    size: "medium",
    suffix: CustomComponent,
    valid: true,
  };

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

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