"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var import_jsx_runtime = require("react/jsx-runtime");
var import_react = __toESM(require("react"));
var import_react2 = require("@testing-library/react");
var import_yoga_icons = require("@gympass/yoga-icons");
var import__ = require("../..");
var import_ActionRequirement = __toESM(require("./ActionRequirement"));
function handleGetList() {
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import__.Text, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_yoga_icons.Dumbbell, {}),
      " 1x/day standard access"
    ] }),
    /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import__.Text, { mt: "small", children: [
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_yoga_icons.User, {}),
      " 4x/month 1-on-1 sessions"
    ] }),
    /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import__.Text, { mt: "small", children: [
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_yoga_icons.Star, {}),
      " 2x/month premium classes"
    ] })
  ] });
}
describe("<ActionRequirement />", () => {
  it("should default match snapshot", () => {
    const { container } = (0, import_react2.render)(
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ActionRequirement.default, { title: "title", description: "description" }) })
    );
    expect(container).toMatchSnapshot();
  });
  it("should match snapshot with list", () => {
    const { container } = (0, import_react2.render)(
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
        import_ActionRequirement.default,
        {
          title: "title",
          description: "description",
          list: handleGetList()
        }
      ) })
    );
    expect(container).toMatchSnapshot();
  });
  it("should match snapshot with text display", () => {
    const { container } = (0, import_react2.render)(
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
        import_ActionRequirement.default,
        {
          title: "title",
          description: "description",
          titleAsTextDisplay: true
        }
      ) })
    );
    expect(container).toMatchSnapshot();
  });
  it("should match snapshot with aria-level 2", () => {
    const { container } = (0, import_react2.render)(
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
        import_ActionRequirement.default,
        {
          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 } = (0, import_react2.render)(
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ActionRequirement.default, { title: "title", description: descriptions }) })
    );
    descriptions.forEach((d) => {
      expect(getByText(d)).toBeTruthy();
    });
  });
});
