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

describe("ActionSheet Component", () => {
  const props: ActionSheetProps = {
    animation: true,
    animationDuration: 300,
    children: <div>Child Content</div>,
    className: "custom-class",
    expand: true,
    items: [
      {
        title: "Item 1",
      },
      {
        title: "Item 2",
      },
    ],
    navigatable: true,
    navigatableElements: [".item1", ".item2"],
    subTitle: "Sub Title",
    tabIndex: 0,
    title: "Main Title",
  };

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

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