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

describe("TextArea Component", () => {
  const props: TextAreaProps = {
    
    ariaDescribedBy: 'description-id',
    autoSize: false,
    className: 'custom-textarea',
    defaultValue: 'Default text',
    dir: 'ltr',
    disabled: false,
    fillMode: 'solid',
    id: 'textarea-id',
    name: 'textarea-name',
    placeholder: 'Enter text here',
    readOnly: false,
    required: false,
    rounded: 'medium',
    rows: 3,
    size: 'medium',
    style: { color: 'blue' },
    tabIndex: 0,
    valid: true,
    validationMessage: '',
    validityStyles: true,
    value: 'Initial value'

  };

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

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