"use strict";

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