import { jsx, jsxs } from "react/jsx-runtime";
import React from "react";
import { render } from "@testing-library/react";
import { Upload2 } from "@gympass/yoga-icons/src";
import { ThemeProvider, Heading } from "../..";
import Title from "./Title";
import BackButton from "./BackButton";
import RightButton from "./RightButton";
const onClick = () => {
};
describe("<Heading />", () => {
  it("should match snapshot with title", () => {
    const { container } = render(
      /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Heading, { children: /* @__PURE__ */ jsx(Title, { children: "Gympass" }) }) })
    );
    expect(container).toMatchSnapshot();
  });
  it("should match snapshot with title and back button", () => {
    const { container } = render(
      /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsxs(Heading, { children: [
        /* @__PURE__ */ jsx(Title, { children: "Gympass" }),
        /* @__PURE__ */ jsx(BackButton, { onClick })
      ] }) })
    );
    expect(container).toMatchSnapshot();
  });
  it("should match snapshot with all components", () => {
    const { container } = render(
      /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsxs(Heading, { children: [
        /* @__PURE__ */ jsx(Title, { children: "Gympass" }),
        /* @__PURE__ */ jsx(BackButton, { onClick }),
        /* @__PURE__ */ jsx(RightButton, { icon: Upload2, onClick })
      ] }) })
    );
    expect(container).toMatchSnapshot();
  });
  it("should match snapshot with back button", () => {
    const { container } = render(
      /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Heading, { children: /* @__PURE__ */ jsx(BackButton, { onClick }) }) })
    );
    expect(container).toMatchSnapshot();
  });
  it("should match snapshot no padding", () => {
    const { container } = render(
      /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsxs(Heading, { noPadding: true, children: [
        /* @__PURE__ */ jsx(Title, { children: "Gympass" }),
        /* @__PURE__ */ jsx(BackButton, { onClick }),
        /* @__PURE__ */ jsx(RightButton, { icon: Upload2, onClick })
      ] }) })
    );
    expect(container).toMatchSnapshot();
  });
  it("should have aria-label", () => {
    const { getByLabelText } = render(
      /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsxs(Heading, { noPadding: true, children: [
        /* @__PURE__ */ jsx(Title, { children: "Gympass" }),
        /* @__PURE__ */ jsx(BackButton, { onClick }),
        /* @__PURE__ */ jsx(
          RightButton,
          {
            icon: Upload2,
            onClick,
            "aria-label": "labelAriaText"
          }
        )
      ] }) })
    );
    expect(getByLabelText("labelAriaText")).toBeTruthy();
  });
  it("should override the background color", () => {
    const { container } = render(
      /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Heading, { bg: "yoga", children: /* @__PURE__ */ jsx(Title, { children: "Gympass" }) }) })
    );
    expect(container).toMatchSnapshot();
  });
});
