import { jsx, jsxs } from "react/jsx-runtime";
import React from "react";
import { Text } from "react-native";
import { render } from "@testing-library/react-native";
import ThemeProvider from "../../Theme";
import Stepper from "..";
describe("<Stepper />", () => {
  describe("Snapshots", () => {
    it("should match snapshot with first step active", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsxs(Stepper, { activeStep: 0, children: [
          /* @__PURE__ */ jsx(Stepper.Step, { label: "step one", children: /* @__PURE__ */ jsx(Text, { children: "step one content" }) }),
          /* @__PURE__ */ jsx(Stepper.Step, { label: "step two", children: /* @__PURE__ */ jsx(Text, { children: "step two content" }) }),
          /* @__PURE__ */ jsx(Stepper.Step, { label: "step three", children: /* @__PURE__ */ jsx(Text, { children: "step three content" }) })
        ] }) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot with first step active and secondary color", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsxs(Stepper, { activeStep: 0, secondary: true, children: [
          /* @__PURE__ */ jsx(Stepper.Step, { label: "step one", children: /* @__PURE__ */ jsx(Text, { children: "step one content" }) }),
          /* @__PURE__ */ jsx(Stepper.Step, { label: "step two", children: /* @__PURE__ */ jsx(Text, { children: "step two content" }) }),
          /* @__PURE__ */ jsx(Stepper.Step, { label: "step three", children: /* @__PURE__ */ jsx(Text, { children: "step three content" }) })
        ] }) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
    it("should match snapshot with second step active", () => {
      const { toJSON } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsxs(Stepper, { activeStep: 1, children: [
          /* @__PURE__ */ jsx(Stepper.Step, { label: "step one", children: /* @__PURE__ */ jsx(Text, { children: "step one content" }) }),
          /* @__PURE__ */ jsx(Stepper.Step, { label: "step two", children: /* @__PURE__ */ jsx(Text, { children: "step two content" }) }),
          /* @__PURE__ */ jsx(Stepper.Step, { label: "step three", children: /* @__PURE__ */ jsx(Text, { children: "step three content" }) })
        ] }) })
      );
      expect(toJSON()).toMatchSnapshot();
    });
  });
  describe("Steps", () => {
    it("should change the active step", () => {
      const { queryByText, rerender } = render(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsxs(Stepper, { activeStep: 0, children: [
          /* @__PURE__ */ jsx(Stepper.Step, { label: "step one", children: /* @__PURE__ */ jsx(Text, { children: "step one content" }) }),
          /* @__PURE__ */ jsx(Stepper.Step, { label: "step two", children: /* @__PURE__ */ jsx(Text, { children: "step two content" }) }),
          /* @__PURE__ */ jsx(Stepper.Step, { label: "step three", children: /* @__PURE__ */ jsx(Text, { children: "step three content" }) })
        ] }) })
      );
      expect(queryByText("step one content")).toBeTruthy();
      expect(queryByText("step two content")).toBeFalsy();
      expect(queryByText("step three content")).toBeFalsy();
      rerender(
        /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsxs(Stepper, { activeStep: 1, children: [
          /* @__PURE__ */ jsx(Stepper.Step, { label: "step one", children: /* @__PURE__ */ jsx(Text, { children: "step one content" }) }),
          /* @__PURE__ */ jsx(Stepper.Step, { label: "step two", children: /* @__PURE__ */ jsx(Text, { children: "step two content" }) }),
          /* @__PURE__ */ jsx(Stepper.Step, { label: "step three", children: /* @__PURE__ */ jsx(Text, { children: "step three content" }) })
        ] }) })
      );
      expect(queryByText("step one content")).toBeFalsy();
      expect(queryByText("step two content")).toBeTruthy();
      expect(queryByText("step three content")).toBeFalsy();
    });
  });
});
