"use strict";

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

var _enzyme = require("enzyme");

var _LabeledIconButton = _interopRequireDefault(require("../LabeledIconButton"));

var _LabeledIconButtonModule = _interopRequireDefault(require("../LabeledIconButton.module.css"));

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

describe('LabeledIconButton Specs', function () {
  test('should render label when given children', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'Hello LabeledIconButton';
    var actual = subject.find('label').text();
    expect(actual).toBe(expected);
  });
  test('should not render children when no children is passed', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature"
    }));
    var expected = '';
    var actual = subject.find('label').text();
    expect(actual).toBe(expected);
  });
  test('should render disabled LabeledIconButton', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      disabled: true,
      icon: "temperature",
      children: "Hello LabeledIconButton"
    }));
    var expected = true;
    var actual = subject.find('LabeledIconButton').prop('disabled');
    expect(actual).toBe(expected);
  });
  test('should render highlighted LabeledIconButton', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      highlighted: true,
      icon: "temperature",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'highlighted';
    var actual = subject.find("div.".concat(_LabeledIconButtonModule["default"].button)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should render selected LabeledIconButton', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      selected: true,
      children: "Hello LabeledIconButton"
    }));
    var expected = 'selected';
    var actual = subject.find("div.".concat(_LabeledIconButtonModule["default"].button)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should render inline LabeledIconButton', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      inline: true,
      children: "Hello LabeledIconButton"
    }));
    var expected = 'inline';
    var actual = subject.find("div.".concat(_LabeledIconButtonModule["default"].labeledIconButton)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should render smallest LabeledIconButton', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      size: "smallest",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'smallest';
    var actual = subject.find("div.".concat(_LabeledIconButtonModule["default"].button)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should render small LabeledIconButton', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      size: "small",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'small';
    var actual = subject.find("div.".concat(_LabeledIconButtonModule["default"].button)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should render large LabeledIconButton by default', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'large';
    var actual = subject.find("div.".concat(_LabeledIconButtonModule["default"].button)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should render huge LabeledIconButton', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      size: "huge",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'huge';
    var actual = subject.find("div.".concat(_LabeledIconButtonModule["default"].button)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should render LabeledIconButton with label position left', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      labelPosition: "left",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'left';
    var actual = subject.find("div.".concat(_LabeledIconButtonModule["default"].labeledIconButton)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should render LabeledIconButton with label position right', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      labelPosition: "right",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'right';
    var actual = subject.find("div.".concat(_LabeledIconButtonModule["default"].labeledIconButton)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should render LabeledIconButton with label position above', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      labelPosition: "above",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'above';
    var actual = subject.find("div.".concat(_LabeledIconButtonModule["default"].labeledIconButton)).prop('className');
    expect(actual).toContain(expected);
  });
  test('should render LabeledIconButton with label position below', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      labelPosition: "below",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'below';
    var actual = subject.find("div.".concat(_LabeledIconButtonModule["default"].labeledIconButton)).prop('className');
    expect(actual).toContain(expected);
  });
});