"use strict";

var _jsxRuntime = require("react/jsx-runtime");

var _enzyme = require("enzyme");

var _Icon = require("../Icon");

var _IconModule = _interopRequireDefault(require("../Icon.module.css"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

describe('Icon Specs', function () {
  test('should return the correct Unicode value for named icon \'wifi\'', function () {
    var icon = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconBase, {
      children: "wifi"
    }));
    var expected = 983059; // decimal converted charCode of Unicode 'star' character

    var actual = icon.text().codePointAt();
    expect(actual).toBe(expected);
  });
  test('should return the correct Unicode value when provided \'star\' hex value', function () {
    var icon = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconBase, {
      children: "0x0F0028"
    }));
    var expected = 983080; // decimal converted charCode of character

    var actual = icon.text().codePointAt();
    expect(actual).toBe(expected);
  });
  test('should return the correct Unicode value when provided HTML entity as hex value', function () {
    var icon = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconBase, {
      children: "\u2605"
    }));
    var expected = 9733; // decimal converted charCode of character

    var actual = icon.text().codePointAt();
    expect(actual).toBe(expected);
  });
  test('should return the correct Unicode value when provided Unicode reference', function () {
    var icon = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconBase, {
      children: "\\u0F0028"
    }));
    var expected = 983080; // decimal converted charCode of Unicode 'star' character

    var actual = icon.text().codePointAt();
    expect(actual).toBe(expected);
  });
  test('should support high code point Unicode values', function () {
    var icon = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconBase, {
      children: String.fromCodePoint(0x0F0028)
    }));
    var expected = 983080; // decimal converted charCode of Unicode 'star' character

    var actual = icon.text().codePointAt();
    expect(actual).toBe(expected);
  });
  test('should support preset size "smallest"', function () {
    var icon = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconBase, {
      size: "smallest",
      children: "wifi"
    }));
    var expected = 'smallest';
    var actual = icon.find("div.".concat(_IconModule["default"].icon)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should support preset size "small"', function () {
    var icon = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconBase, {
      size: "small",
      children: "wifi"
    }));
    var expected = 'small';
    var actual = icon.find("div.".concat(_IconModule["default"].icon)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should support preset size "large" by default', function () {
    var icon = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconBase, {
      children: "wifi"
    }));
    var expected = 'large';
    var actual = icon.find("div.".concat(_IconModule["default"].icon)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should support preset size "huge"', function () {
    var icon = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconBase, {
      size: "huge",
      children: "wifi"
    }));
    var expected = 'huge';
    var actual = icon.find("div.".concat(_IconModule["default"].icon)).prop('className');
    expect(actual).toContain(expected);
  });
});