import { Fragment, jsx, jsxs } from "react/jsx-runtime";
import React from "react";
import { render } from "@testing-library/react";
import { Dumbbell, User, Star } from "@gympass/yoga-icons";
import { Text, ThemeProvider } from "../..";
import ActionRequirement from "./ActionRequirement";
function handleGetList() {
  return /* @__PURE__ */ jsxs(Fragment, { children: [
    /* @__PURE__ */ jsxs(Text, { children: [
      /* @__PURE__ */ jsx(Dumbbell, {}),
      " 1x/day standard access"
    ] }),
    /* @__PURE__ */ jsxs(Text, { mt: "small", children: [
      /* @__PURE__ */ jsx(User, {}),
      " 4x/month 1-on-1 sessions"
    ] }),
    /* @__PURE__ */ jsxs(Text, { mt: "small", children: [
      /* @__PURE__ */ jsx(Star, {}),
      " 2x/month premium classes"
    ] })
  ] });
}
describe("<ActionRequirement />", () => {
  it("should default match snapshot", () => {
    const { container } = render(
      /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(ActionRequirement, { title: "title", description: "description" }) })
    );
    expect(container).toMatchSnapshot();
  });
  it("should match snapshot with list", () => {
    const { container } = render(
      /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(
        ActionRequirement,
        {
          title: "title",
          description: "description",
          list: handleGetList()
        }
      ) })
    );
    expect(container).toMatchSnapshot();
  });
  it("should match snapshot with text display", () => {
    const { container } = render(
      /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(
        ActionRequirement,
        {
          title: "title",
          description: "description",
          titleAsTextDisplay: true
        }
      ) })
    );
    expect(container).toMatchSnapshot();
  });
  it("should match snapshot with aria-level 2", () => {
    const { container } = render(
      /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(
        ActionRequirement,
        {
          title: "title",
          description: "description",
          titleAsTextDisplay: true,
          ariaLevelTitle: 2
        }
      ) })
    );
    expect(container).toMatchSnapshot();
  });
  it("should render multiple paragraphs when description is an array", () => {
    const descriptions = [
      "First requirement paragraph.",
      "Second requirement giving more context.",
      "Final requirement details here."
    ];
    const { getByText } = render(
      /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(ActionRequirement, { title: "title", description: descriptions }) })
    );
    descriptions.forEach((d) => {
      expect(getByText(d)).toBeTruthy();
    });
  });
});
