"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_react_native = require("@testing-library/react-native");
var import_yoga_icons = require("@gympass/yoga-icons");
var import__ = require("../../..");
var import__2 = __toESM(require("."));
describe("<PlanCard />", () => {
  const buttonOnPressMock = jest.fn();
  const renderPlan = () => (0, import_react_native.render)(
    /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import__2.default, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__2.default.Tag, { variant: "informative", children: "Recommended Plan" }),
      /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
        import__2.default.Content,
        {
          subtitle: "plan",
          title: "Basic",
          currency: "$",
          price: "99.90",
          period: "/month",
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__2.default.Subtitle, { children: "Get access to" }),
            /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import__2.default.List, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
                import__2.default.ListItem,
                {
                  icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
                    import__.Icon,
                    {
                      as: import_yoga_icons.MapPin,
                      height: "small",
                      width: "small",
                      stroke: "medium"
                    }
                  ),
                  text: "gyms and studios"
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
                import__2.default.ListItem,
                {
                  icon: import_yoga_icons.Star,
                  text: "list item",
                  buttonProps: {
                    children: "button",
                    onPress: buttonOnPressMock
                  }
                }
              )
            ] })
          ]
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__2.default.Actions, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Button, { full: true, children: "Select this plan" }) })
    ] }) })
  );
  describe("Events", () => {
    it("should call onPress when ListItem has a button", () => {
      const { getByText } = renderPlan();
      import_react_native.fireEvent.press(getByText("button"));
      expect(buttonOnPressMock).toHaveBeenCalled();
    });
  });
  describe("Snapshots", () => {
    it("should match snapshot with default PlanCard", () => {
      const { toJSON } = renderPlan();
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot with variant", () => {
      const { toJSON } = (0, import_react_native.render)(
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__2.default, { variant: "hope", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
          import__2.default.Content,
          {
            subtitle: "plan",
            title: "Basic",
            currency: "$",
            price: "99.90",
            period: "/month"
          }
        ) }) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot with suffix", () => {
      const { toJSON } = (0, import_react_native.render)(
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__2.default, { variant: "hope", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
          import__2.default.Content,
          {
            subtitle: "plan",
            title: "Basic",
            currency: "$",
            suffix: "MXN",
            price: "99.90",
            period: "/month"
          }
        ) }) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
  });
});
