"use strict";

require("@testing-library/jest-dom");
var _react = require("@testing-library/react");
var _LabeledIconButton = _interopRequireDefault(require("../LabeledIconButton"));
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
describe('LabeledIconButton Specs', function () {
  test('should render label when given children', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'Hello LabeledIconButton';
    var actual = _react.screen.getByText(expected);
    expect(actual).toHaveClass('label');
  });
  test('should not render children when no children is passed', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature"
    }));
    var expected = '';
    var actual = _react.screen.getAllByRole('button')[0].children[1];
    expect(actual).toHaveTextContent(expected);
  });
  test('should render disabled LabeledIconButton', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      disabled: true,
      icon: "temperature",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'disabled';
    var actual = _react.screen.getAllByRole('button')[0];
    expect(actual).toHaveAttribute(expected);
  });
  test('should render highlighted LabeledIconButton', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      highlighted: true,
      icon: "temperature",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'highlighted';
    var actual = _react.screen.getAllByRole('button')[1];
    expect(actual).toHaveClass(expected);
  });
  test('should render selected LabeledIconButton', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      selected: true,
      children: "Hello LabeledIconButton"
    }));
    var expected = 'selected';
    var actual = _react.screen.getAllByRole('button')[0];
    expect(actual).toHaveClass(expected);
  });
  test('should render inline LabeledIconButton', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      inline: true,
      children: "Hello LabeledIconButton"
    }));
    var expected = 'inline';
    var actual = _react.screen.getAllByRole('button')[0];
    expect(actual).toHaveClass(expected);
  });
  test('should render smallest LabeledIconButton', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      size: "smallest",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'smallest';
    var actual = _react.screen.getAllByRole('button')[0];
    expect(actual).toHaveClass(expected);
  });
  test('should render small LabeledIconButton', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      size: "small",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'small';
    var actual = _react.screen.getAllByRole('button')[0];
    expect(actual).toHaveClass(expected);
  });
  test('should render large LabeledIconButton by default', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'large';
    var actual = _react.screen.getAllByRole('button')[0];
    expect(actual).toHaveClass(expected);
  });
  test('should render huge LabeledIconButton', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      size: "huge",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'huge';
    var actual = _react.screen.getAllByRole('button')[0];
    expect(actual).toHaveClass(expected);
  });
  test('should render LabeledIconButton with label position left', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      labelPosition: "left",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'left';
    var actual = _react.screen.getAllByRole('button')[0];
    expect(actual).toHaveClass(expected);
  });
  test('should render LabeledIconButton with label position right', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      labelPosition: "right",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'right';
    var actual = _react.screen.getAllByRole('button')[0];
    expect(actual).toHaveClass(expected);
  });
  test('should render LabeledIconButton with label position above', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      labelPosition: "above",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'above';
    var actual = _react.screen.getAllByRole('button')[0];
    expect(actual).toHaveClass(expected);
  });
  test('should render LabeledIconButton with label position below', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIconButton["default"], {
      icon: "temperature",
      labelPosition: "below",
      children: "Hello LabeledIconButton"
    }));
    var expected = 'below';
    var actual = _react.screen.getAllByRole('button')[0];
    expect(actual).toHaveClass(expected);
  });
});