var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
import { jsx, jsxs } from "react/jsx-runtime";
import React from "react";
import { render } from "@testing-library/react-native";
import Svg, { Circle } from "react-native-svg";
import { ThemeProvider } from "../..";
import Rating from ".";
describe("<Rating />", () => {
  describe("Snapshots", () => {
    it("should match snapshot with Rating", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Rating, {}) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot when it is not readOnly", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Rating, { readOnly: false }) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot with different values", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsxs(ThemeProvider, { children: [
          /* @__PURE__ */ jsx(Rating, { value: 0 }),
          /* @__PURE__ */ jsx(Rating, { value: 0.5 }),
          /* @__PURE__ */ jsx(Rating, { value: 1 }),
          /* @__PURE__ */ jsx(Rating, { value: 1.1 }),
          /* @__PURE__ */ jsx(Rating, { value: 1.2 }),
          /* @__PURE__ */ jsx(Rating, { value: 1.3 }),
          /* @__PURE__ */ jsx(Rating, { value: 1.4 }),
          /* @__PURE__ */ jsx(Rating, { value: 1.5 }),
          /* @__PURE__ */ jsx(Rating, { value: 1.6 }),
          /* @__PURE__ */ jsx(Rating, { value: 1.7 }),
          /* @__PURE__ */ jsx(Rating, { value: 1.8 }),
          /* @__PURE__ */ jsx(Rating, { value: 1.9 }),
          /* @__PURE__ */ jsx(Rating, { value: 2 }),
          /* @__PURE__ */ jsx(Rating, { value: 2.5 }),
          /* @__PURE__ */ jsx(Rating, { value: 3 }),
          /* @__PURE__ */ jsx(Rating, { value: 3.5 }),
          /* @__PURE__ */ jsx(Rating, { value: 4 }),
          /* @__PURE__ */ jsx(Rating, { value: 4.5 })
        ] })
      );
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot with different icon quantity", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsxs(ThemeProvider, { children: [
          /* @__PURE__ */ jsx(Rating, { max: 3, value: 0 }),
          /* @__PURE__ */ jsx(Rating, { max: 3, value: 0.5 }),
          /* @__PURE__ */ jsx(Rating, { max: 3, value: 1 }),
          /* @__PURE__ */ jsx(Rating, { max: 3, value: 1.5 }),
          /* @__PURE__ */ jsx(Rating, { max: 3, value: 2 }),
          /* @__PURE__ */ jsx(Rating, { max: 3, value: 2.5 }),
          /* @__PURE__ */ jsx(Rating, { max: 3, value: 3 })
        ] })
      );
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot with different icon", () => {
      const CircleIcon = (props) => /* @__PURE__ */ jsx(Svg, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx(Circle, { cx: 12, cy: 12, r: 12 }) }));
      const { toJSON } = render(
        /* @__PURE__ */ jsxs(ThemeProvider, { children: [
          /* @__PURE__ */ jsx(Rating, { icon: { type: CircleIcon }, value: 0 }),
          /* @__PURE__ */ jsx(Rating, { icon: { type: CircleIcon }, value: 1 }),
          /* @__PURE__ */ jsx(Rating, { icon: { type: CircleIcon }, value: 2 })
        ] })
      );
      expect(toJSON()).toMatchSnapshot();
    });
  });
});
