"use strict";

import { render } from "@testing-library/react-native";
import { Alert } from "react-native";
import { Body } from "../Body";
import { BodyMonospace } from "../BodyMonospace";
import { BodySmall } from "../BodySmall";
import { ButtonText } from "../ButtonText";
import { calculateWeightColor } from "../common";
import { H1 } from "../H1";
import { H2 } from "../H2";
import { H3 } from "../H3";
import { H4 } from "../H4";
import { H5 } from "../H5";
import { H6 } from "../H6";
import { jsx as _jsx } from "react/jsx-runtime";
describe("Test Typography Components", () => {
  it("H1 Snapshot", () => {
    const {
      toJSON: H1Default
    } = render(/*#__PURE__*/_jsx(H1, {
      children: "Text"
    }));
    expect(H1Default()).toMatchSnapshot();
    const {
      toJSON: H1White
    } = render(/*#__PURE__*/_jsx(H1, {
      color: "white",
      children: "Text"
    }));
    expect(H1White()).toMatchSnapshot();
  });
  it("H2 Snapshot", () => {
    const {
      toJSON: H2Default
    } = render(/*#__PURE__*/_jsx(H2, {
      children: "Text"
    }));
    expect(H2Default()).toMatchSnapshot();
  });
  it("H3 Snapshot", () => {
    // SemiBold weight, default weight
    const {
      toJSON: H3Default
    } = render(/*#__PURE__*/_jsx(H3, {
      children: "Text"
    }));
    expect(H3Default()).toMatchSnapshot();
    const {
      toJSON: H3Grey
    } = render(/*#__PURE__*/_jsx(H3, {
      color: "grey-200",
      children: "Text"
    }));
    expect(H3Grey()).toMatchSnapshot();
    const {
      toJSON: H3White
    } = render(/*#__PURE__*/_jsx(H3, {
      color: "white",
      children: "Text"
    }));
    expect(H3White()).toMatchSnapshot();
  });
  it("H4 Snapshot", () => {
    // Bold weight, default weight
    const {
      toJSON: H4Default
    } = render(/*#__PURE__*/_jsx(H4, {
      children: "Text"
    }));
    expect(H4Default()).toMatchSnapshot();
    const {
      toJSON: H4Blue
    } = render(/*#__PURE__*/_jsx(H4, {
      color: "blueIO-500",
      children: "Text"
    }));
    expect(H4Blue()).toMatchSnapshot();
    const {
      toJSON: H4White
    } = render(/*#__PURE__*/_jsx(H4, {
      color: "white",
      children: "Text"
    }));
    expect(H4White()).toMatchSnapshot();
  });
  it("H5 Snapshot", () => {
    // SemiBold weight, default
    const {
      toJSON: H5Default
    } = render(/*#__PURE__*/_jsx(H5, {
      children: "Text"
    }));
    expect(H5Default()).toMatchSnapshot();
    const {
      toJSON: H5Grey
    } = render(/*#__PURE__*/_jsx(H5, {
      color: "grey-700",
      children: "Text"
    }));
    expect(H5Grey()).toMatchSnapshot();
    const {
      toJSON: H5Blue
    } = render(/*#__PURE__*/_jsx(H5, {
      color: "blueIO-500",
      children: "Text"
    }));
    expect(H5Blue()).toMatchSnapshot();
    const {
      toJSON: H5White
    } = render(/*#__PURE__*/_jsx(H5, {
      color: "white",
      children: "Text"
    }));
    expect(H5White()).toMatchSnapshot();
  });
  it("H6 Snapshot", () => {
    // SemiBold weight, default
    const {
      toJSON: H6Default
    } = render(/*#__PURE__*/_jsx(H6, {
      children: "Text"
    }));
    expect(H6Default()).toMatchSnapshot();
  });
  it("Body Snapshot", () => {
    const {
      toJSON: BodyDefault
    } = render(/*#__PURE__*/_jsx(Body, {
      children: "Text"
    }));
    expect(BodyDefault()).toMatchSnapshot();
  });
  it("ButtonText Snapshot", () => {
    const {
      toJSON: ButtonTextDefault
    } = render(/*#__PURE__*/_jsx(ButtonText, {
      children: "Text"
    }));
    expect(ButtonTextDefault()).toMatchSnapshot();
  });
  it("BodySmall Snapshot", () => {
    const {
      toJSON: toJSONDefault
    } = render(/*#__PURE__*/_jsx(BodySmall, {
      children: "Text"
    }));
    expect(toJSONDefault()).toMatchSnapshot();
    const allowedColors = ["blueIO-500", "grey-700", "error-600", "white"];
    allowedColors.map(color => {
      const {
        toJSON: componentVariant
      } = render(/*#__PURE__*/_jsx(BodySmall, {
        color: color,
        children: "Text"
      }));
      expect(componentVariant()).toMatchSnapshot();
    });
  });
  it("Body as Link Snapshot", () => {
    const {
      toJSON: BodyLink
    } = render(/*#__PURE__*/_jsx(Body, {
      asLink: true,
      onPress: () => Alert.alert("Pressed"),
      children: "Text"
    }));
    expect(BodyLink()).toMatchSnapshot();
  });
  it("BodyMonospace Snapshot", () => {
    const {
      toJSON: BodyMonospaceDefault
    } = render(/*#__PURE__*/_jsx(BodyMonospace, {
      children: "Text"
    }));
    expect(BodyMonospaceDefault()).toMatchSnapshot();
  });
});
describe("Test Typography common", () => {
  it("Test calculateWeightColor behaviour", () => {
    const noValues = calculateWeightColor("Bold", "error-600");
    expect(noValues.color).toBe("error-600");
    expect(noValues.weight).toBe("Bold");
    const weightProvided = calculateWeightColor("Bold", "error-600", "Regular");
    expect(weightProvided.color).toBe("error-600");
    expect(weightProvided.weight).toBe("Regular");
    const allValuesProvided = calculateWeightColor("Bold", "error-600", "Regular", "grey-700");
    expect(allValuesProvided.color).toBe("grey-700");
    expect(allValuesProvided.weight).toBe("Regular");
  });
});
//# sourceMappingURL=typography.test.js.map