"use strict";

require("@testing-library/jest-dom");
var _react = require("@testing-library/react");
var _LabeledIcon = _interopRequireDefault(require("../LabeledIcon"));
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
describe('LabeledIcon Specs', function () {
  test('should support label when given children', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      children: "Hello LabeledIcon"
    }));
    var expected = 'Hello LabeledIcon';
    var actual = _react.screen.getByText(expected);
    expect(actual).toHaveClass('label');
  });
  test('should apply flipBoth class when flip prop equals "both"', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      flip: "both",
      children: "Hello LabeledIcon"
    }));
    var expected = 'flipBoth';
    var actual = _react.screen.getByText('Hello LabeledIcon').previousElementSibling.children[0];
    expect(actual).toHaveClass(expected);
  });
  test('should apply flipHorizontal class when flip prop equals "horizontal"', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      flip: "horizontal",
      children: "Hello LabeledIcon"
    }));
    var expected = 'flipHorizontal';
    var actual = _react.screen.getByText('Hello LabeledIcon').previousElementSibling.children[0];
    expect(actual).toHaveClass(expected);
  });
  test('should apply flipVertical class when flip prop equals "vertical"', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      flip: "vertical",
      children: "Hello LabeledIcon"
    }));
    var expected = 'flipVertical';
    var actual = _react.screen.getByText('Hello LabeledIcon').previousElementSibling.children[0];
    expect(actual).toHaveClass(expected);
  });
  test('should support custom icon', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      icon: "0x0F0014",
      children: "Hello LabeledIcon"
    }));
    var expected = 983060; // decimal converted charCode of 'happyface' character
    var actual = _react.screen.getByText('Hello LabeledIcon').previousElementSibling.children[0].textContent.codePointAt();
    expect(actual).toBe(expected);
  });
  test('should apply inline class when inline prop is set to true', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      inline: true,
      children: "Hello LabeledIcon"
    }));
    var expected = 'inline';
    var actual = _react.screen.getByText('Hello LabeledIcon').parentElement;
    expect(actual).toHaveClass(expected);
  });
  test('should have above class when labelPosition prop equals "above"', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      labelPosition: "above",
      children: "Hello LabeledIcon"
    }));
    var expected = 'above';
    var actual = _react.screen.getByText('Hello LabeledIcon').parentElement;
    expect(actual).toHaveClass(expected);
  });
  test('should have below class by default', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      children: "Hello LabeledIcon"
    }));
    var expected = 'below';
    var actual = _react.screen.getByText('Hello LabeledIcon').parentElement;
    expect(actual).toHaveClass(expected);
  });
  test('should have before class when labelPosition prop equals "before"', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      labelPosition: "before",
      children: "Hello LabeledIcon"
    }));
    var expected = 'before';
    var actual = _react.screen.getByText('Hello LabeledIcon').parentElement;
    expect(actual).toHaveClass(expected);
  });
  test('should have after class when labelPosition prop equals "after"', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      labelPosition: "after",
      children: "Hello LabeledIcon"
    }));
    var expected = 'after';
    var actual = _react.screen.getByText('Hello LabeledIcon').parentElement;
    expect(actual).toHaveClass(expected);
  });
  test('should have left class when labelPosition prop equals "left"', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      labelPosition: "left",
      children: "Hello LabeledIcon"
    }));
    var expected = 'left';
    var actual = _react.screen.getByText('Hello LabeledIcon').parentElement;
    expect(actual).toHaveClass(expected);
  });
  test('should have right class when labelPosition prop equals "right"', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      labelPosition: "right",
      children: "Hello LabeledIcon"
    }));
    var expected = 'right';
    var actual = _react.screen.getByText('Hello LabeledIcon').parentElement;
    expect(actual).toHaveClass(expected);
  });
  test('should apply small class to Icon when size prop equals "small"', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      size: "small",
      children: "Hello LabeledIcon"
    }));
    var expected = 'small';
    var actual = _react.screen.getByText('Hello LabeledIcon').parentElement;
    expect(actual).toHaveClass(expected);
  });
  test('should apply large class to Icon by default', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      children: "Hello LabeledIcon"
    }));
    var expected = 'large';
    var actual = _react.screen.getByText('Hello LabeledIcon').previousElementSibling.children[0];
    expect(actual).toHaveClass(expected);
  });
});