"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("../..");
describe("<Chips />", () => {
  describe("Snapshots", () => {
    it("should match snapshot", () => {
      const { container } = (0, import_react2.render)(
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { children: "Classes" }) })
      );
      expect(container).toMatchSnapshot();
    });
    it("should match snapshot with disabled prop", () => {
      const { container } = (0, import_react2.render)(
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { disabled: true, children: "Classes" }) })
      );
      expect(container).toMatchSnapshot();
    });
    it("should match snapshot with more than one Chip", () => {
      const { container } = (0, import_react2.render)(
        /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import__.ThemeProvider, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { children: "Classes" }),
          /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { children: "Gyms and studios" }),
          /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { children: "Personal trainers" })
        ] })
      );
      expect(container).toMatchSnapshot();
    });
    describe("selected", () => {
      it("should match snapshot", () => {
        const { container } = (0, import_react2.render)(
          /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { selected: true, children: "Classes" }) })
        );
        expect(container).toMatchSnapshot();
      });
      it("should match snapshot with more than one Chip", () => {
        const { container } = (0, import_react2.render)(
          /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import__.ThemeProvider, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { children: "Classes" }),
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { selected: true, children: "Gyms and studios" }),
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { selected: true, children: "Personal trainers" })
          ] })
        );
        expect(container).toMatchSnapshot();
      });
    });
    describe("counter", () => {
      it("should match snapshot", () => {
        const { container } = (0, import_react2.render)(
          /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { counter: 8, children: "Classes" }) })
        );
        expect(container).toMatchSnapshot();
      });
      it("should match snapshot with more than one Chip", () => {
        const { container } = (0, import_react2.render)(
          /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import__.ThemeProvider, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { counter: 8, children: "Classes" }),
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { counter: 52, selected: true, children: "Gyms and studios" }),
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { counter: 1732, selected: true, children: "Personal trainers" })
          ] })
        );
        expect(container).toMatchSnapshot();
      });
    });
    describe("icon", () => {
      it("should match selected snapshot", () => {
        const { container } = (0, import_react2.render)(
          /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import__.ThemeProvider, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { counter: 8, icon: [import_yoga_icons.MapPin], children: "Location" }),
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { counter: 8, icon: [import_yoga_icons.MapPin, import_yoga_icons.ChevronDown], children: "Classes" }),
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { icon: [import_yoga_icons.MapPin, import_yoga_icons.ChevronDown], children: "Gyms and studios" }),
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { icon: [import_yoga_icons.MapPin], children: "Personal trainers" }),
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { counter: 8, selected: true, icon: [import_yoga_icons.MapPin], children: "Activities" }),
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { counter: 8, selected: true, icon: [import_yoga_icons.MapPin, import_yoga_icons.ChevronDown], children: "Language" }),
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { selected: true, icon: [import_yoga_icons.MapPin, import_yoga_icons.ChevronDown], children: "Categories" }),
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { selected: true, icon: [import_yoga_icons.MapPin], children: "Availability" })
          ] })
        );
        expect(container).toMatchSnapshot();
      });
    });
  });
  describe("Events", () => {
    it("should toggle", () => {
      const toggleMock = jest.fn();
      const { getByText } = (0, import_react2.render)(
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { onClick: toggleMock, children: "Classes" }) })
      );
      import_react2.fireEvent.click(getByText("Classes"));
      expect(toggleMock).toHaveBeenCalled();
    });
    it("should toggle using onToggle", () => {
      const toggleMock = jest.fn();
      const { getByText } = (0, import_react2.render)(
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ThemeProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Chips, { onToggle: toggleMock, children: "Classes" }) })
      );
      import_react2.fireEvent.click(getByText("Classes"));
      expect(toggleMock).toHaveBeenCalled();
    });
  });
});
