"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_Theme = __toESM(require("../../Theme"));
var import_Slider = __toESM(require("./Slider"));
describe("<Slider />", () => {
  describe("Snapshots", () => {
    describe("With one marker", () => {
      it("should match snapshot with default Slider", () => {
        const { container } = (0, import_react2.render)(
          /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Slider.default, {}) })
        );
        expect(container).toMatchSnapshot();
      });
      it("should match snapshot with Slider with labels", () => {
        const { container } = (0, import_react2.render)(
          /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Slider.default, { minLabel: 0, maxLabel: 10 }) })
        );
        expect(container).toMatchSnapshot();
      });
      it("should match snapshot with Slider snapped", () => {
        const { container } = (0, import_react2.render)(
          /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Slider.default, { snapped: true }) })
        );
        expect(container).toMatchSnapshot();
      });
    });
    describe("With two markers", () => {
      it("should match snapshot", () => {
        const { container } = (0, import_react2.render)(
          /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Slider.default, { values: [3, 7] }) })
        );
        expect(container).toMatchSnapshot();
      });
      it("should match snapshot with Slider snapped", () => {
        const { container } = (0, import_react2.render)(
          /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Slider.default, { values: [3, 7], snapped: true }) })
        );
        expect(container).toMatchSnapshot();
      });
    });
  });
  describe("Labels", () => {
    it("should render labels", () => {
      const { getByText } = (0, import_react2.render)(
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Slider.default, { maxLabel: "max", minLabel: "min" }) })
      );
      expect(getByText("max").textContent).toBe("max");
      expect(getByText("min").textContent).toBe("min");
    });
  });
  describe("Tooltip", () => {
    it("should render tooltips", () => {
      const { container, getByRole, getByText } = (0, import_react2.render)(
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
          import_Slider.default,
          {
            values: [0],
            tooltip: [
              {
                ribbon: "ribbon",
                title: "title",
                description: "description",
                visible: true
              }
            ]
          }
        ) })
      );
      import_react2.fireEvent.mouseDown(getByRole("slider"));
      expect(getByText("ribbon")).toBeTruthy();
      expect(getByText("title")).toBeTruthy();
      expect(getByText("description")).toBeTruthy();
      expect(container).toMatchSnapshot();
    });
  });
});
