"use strict";

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

var _enzyme = require("enzyme");

var _LabeledIcon = _interopRequireDefault(require("../LabeledIcon"));

var _LabeledIconModule = _interopRequireDefault(require("../LabeledIcon.module.css"));

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

describe('LabeledIcon Specs', function () {
  test('should support label when given children', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      children: "Hello LabeledIcon"
    }));
    var expected = 'Hello LabeledIcon';
    var actual = subject.find('label').text();
    expect(actual).toBe(expected);
  });
  test('should apply flipBoth class when flip prop equals "both"', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      flip: "both",
      children: "Hello LabeledIcon"
    }));
    var expected = 'flipBoth';
    var actual = subject.find("div.".concat(_LabeledIconModule["default"].icon)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should apply flipHorizontal class when flip prop equals "horizontal"', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      flip: "horizontal",
      children: "Hello LabeledIcon"
    }));
    var expected = 'flipHorizontal';
    var actual = subject.find("div.".concat(_LabeledIconModule["default"].icon)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should apply flipVertical class when flip prop equals "vertical"', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      flip: "vertical",
      children: "Hello LabeledIcon"
    }));
    var expected = 'flipVertical';
    var actual = subject.find("div.".concat(_LabeledIconModule["default"].icon)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should support custom icon', function () {
    var expected = 'happyface';
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      icon: expected,
      children: "Hello LabeledIcon"
    }));
    var actual = subject.find('Icon').prop('children');
    expect(actual).toBe(expected);
  });
  test('should apply inline class when inline prop is set to true', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      inline: true,
      children: "Hello LabeledIcon"
    }));
    var expected = 'inline';
    var actual = subject.find("div.".concat(_LabeledIconModule["default"].labeledIcon)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should have above class when labelPosition prop equals "above"', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      labelPosition: "above",
      children: "Hello LabeledIcon"
    }));
    var expected = 'above';
    var actual = subject.find("div.".concat(_LabeledIconModule["default"].labeledIcon)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should have below class by default', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      children: "Hello LabeledIcon"
    }));
    var expected = 'below';
    var actual = subject.find("div.".concat(_LabeledIconModule["default"].labeledIcon)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should have before class when labelPosition prop equals "before"', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      labelPosition: "before",
      children: "Hello LabeledIcon"
    }));
    var expected = 'before';
    var actual = subject.find("div.".concat(_LabeledIconModule["default"].labeledIcon)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should have after class when labelPosition prop equals "after"', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      labelPosition: "after",
      children: "Hello LabeledIcon"
    }));
    var expected = 'after';
    var actual = subject.find("div.".concat(_LabeledIconModule["default"].labeledIcon)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should have left class when labelPosition prop equals "left"', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      labelPosition: "left",
      children: "Hello LabeledIcon"
    }));
    var expected = 'left';
    var actual = subject.find("div.".concat(_LabeledIconModule["default"].labeledIcon)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should have right class when labelPosition prop equals "right"', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      labelPosition: "right",
      children: "Hello LabeledIcon"
    }));
    var expected = 'right';
    var actual = subject.find("div.".concat(_LabeledIconModule["default"].labeledIcon)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should apply small class to Icon when size prop equals "small"', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      size: "small",
      children: "Hello LabeledIcon"
    }));
    var expected = 'small';
    var actual = subject.find("div.".concat(_LabeledIconModule["default"].icon)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should apply large class to Icon by default', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
      children: "Hello LabeledIcon"
    }));
    var expected = 'large';
    var actual = subject.find("div.".concat(_LabeledIconModule["default"].icon)).prop('className');
    expect(actual).toContain(expected);
  });
});