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 } from "react/jsx-runtime";
import React from "react";
import { render, fireEvent } from "@testing-library/react-native";
import Checkbox from "..";
import ThemeProvider from "../../Theme";
const data = {
  label: "Checkbox Component",
  helper: "Helper Text"
};
describe("<Checkbox />", () => {
  describe("Snapshots", () => {
    it("should match snapshot without label", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Checkbox, {}) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot without label", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Checkbox, {}) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot with default checkbox", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Checkbox, __spreadValues({}, data)) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot with disabled checkbox", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Checkbox, __spreadProps(__spreadValues({}, data), { disabled: true })) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot with checked checkbox", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Checkbox, __spreadProps(__spreadValues({}, data), { checked: true })) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot with disabled and checked checkbox", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Checkbox, __spreadProps(__spreadValues({}, data), { disabled: true, checked: true })) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot with error checkbox", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Checkbox, __spreadProps(__spreadValues({}, data), { error: "Error text" })) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot with error and checked checkbox", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Checkbox, __spreadProps(__spreadValues({}, data), { error: "Error text", checked: true })) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot with inverted", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Checkbox, __spreadProps(__spreadValues({}, data), { inverted: true })) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot with inverted and checked", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Checkbox, __spreadProps(__spreadValues({}, data), { inverted: true, checked: true })) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot with inverted and checked and disabled", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Checkbox, __spreadProps(__spreadValues({}, data), { inverted: true, checked: true, disabled: true })) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
  });
  describe("Events", () => {
    it("should call onChange function when press on Checkbox", () => {
      const onChangeMock = jest.fn();
      const { getByTestId } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Checkbox, __spreadProps(__spreadValues({}, data), { onPress: onChangeMock, testID: "checkbox" })) })
      );
      fireEvent.press(getByTestId("checkbox"));
      expect(onChangeMock).toHaveBeenCalled();
    });
  });
});
