"use strict";

require("@testing-library/jest-dom");
var _react = require("@testing-library/react");
var _ProgressBar = _interopRequireWildcard(require("../ProgressBar"));
var _jsxRuntime = require("react/jsx-runtime");
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
describe('ProgressBar Specs', function () {
  test('should only show tooltip when tooltip is true', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
      tooltip: true
    }));
    var actual = _react.screen.getByRole('progressbar').children.item(1);
    var expected = 'tooltip';
    expect(actual).toHaveClass(expected);
  });
  test('should have tooltip show progress as percentage', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
      progress: 0.6,
      tooltip: true
    }));
    var actual = _react.screen.getByRole('progressbar').textContent;
    var expected = '60%';
    expect(actual).toBe(expected);
  });
  describe('ProgressBar with horizontal orientation', function () {
    test('should have default orientation of `horizontal`', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {}));
      var actual = _react.screen.getByRole('progressbar');
      var expected = 'horizontal';
      expect(actual).toHaveClass(expected);
    });
    test('should have tooltip with `above after` className when position is set to `above after`', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar.ProgressBarTooltip, {
          position: "above after"
        })
      }));
      var actual = _react.screen.getByRole('progressbar').children.item(1);
      var expected = 'above after';
      expect(actual).toHaveClass(expected);
    });
    test('should have tooltip with `above before` className when position is set to `above before`', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar.ProgressBarTooltip, {
          position: "above before"
        })
      }));
      var actual = _react.screen.getByRole('progressbar').children.item(1);
      var expected = 'above before';
      expect(actual).toHaveClass(expected);
    });
    test('should have tooltip with `above center` className when position is set to `above center`', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar.ProgressBarTooltip, {
          position: "above center"
        })
      }));
      var actual = _react.screen.getByRole('progressbar').children.item(1);
      var expected = 'above center';
      expect(actual).toHaveClass(expected);
    });
    test('should have tooltip with `above left` className when position is set to `above left`', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar.ProgressBarTooltip, {
          position: "above left"
        })
      }));
      var actual = _react.screen.getByRole('progressbar').children.item(1);
      var expected = 'above left';
      expect(actual).toHaveClass(expected);
    });
    test('should have tooltip with `above right` className when position is set to `above right`', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar.ProgressBarTooltip, {
          position: "above right"
        })
      }));
      var actual = _react.screen.getByRole('progressbar').children.item(1);
      var expected = 'above right';
      expect(actual).toHaveClass(expected);
    });
    test('should have tooltip with `below after` className when position is set to `below after`', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar.ProgressBarTooltip, {
          position: "below after"
        })
      }));
      var actual = _react.screen.getByRole('progressbar').children.item(1);
      var expected = 'below after';
      expect(actual).toHaveClass(expected);
    });
    test('should have tooltip with `below before` className when position is set to `below before`', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar.ProgressBarTooltip, {
          position: "below before"
        })
      }));
      var actual = _react.screen.getByRole('progressbar').children.item(1);
      var expected = 'below before';
      expect(actual).toHaveClass(expected);
    });
    test('should have tooltip with `below center` className when position is set to `below center`', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar.ProgressBarTooltip, {
          position: "below center"
        })
      }));
      var actual = _react.screen.getByRole('progressbar').children.item(1);
      var expected = 'below center';
      expect(actual).toHaveClass(expected);
    });
    test('should have tooltip with `below left` className when position is set to `below left`', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar.ProgressBarTooltip, {
          position: "below left"
        })
      }));
      var actual = _react.screen.getByRole('progressbar').children.item(1);
      var expected = 'below left';
      expect(actual).toHaveClass(expected);
    });
    test('should have tooltip with `below right` className when position is set to `below right`', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar.ProgressBarTooltip, {
          position: "below right"
        })
      }));
      var actual = _react.screen.getByRole('progressbar').children.item(1);
      var expected = 'below right';
      expect(actual).toHaveClass(expected);
    });
    test('should have tooltip with default `above` className when no position is set', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar.ProgressBarTooltip, {})
      }));
      var actual = _react.screen.getByRole('progressbar').children.item(1);
      var expected = 'above';
      expect(actual).toHaveClass(expected);
    });
  });
  describe('ProgressBar with vertical orientation', function () {
    test('should have vertical orientation', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
        orientation: "vertical"
      }));
      var actual = _react.screen.getByRole('progressbar');
      var expected = 'vertical';
      expect(actual).toHaveClass(expected);
    });
    test('should have tooltip with `after` className when position is set to `after`', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
        orientation: "vertical",
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar.ProgressBarTooltip, {
          position: "after"
        })
      }));
      var actual = _react.screen.getByRole('progressbar').children.item(1);
      var expected = 'after';
      expect(actual).toHaveClass(expected);
    });
    test('should have tooltip with `before` className when position is set to `before`', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
        orientation: "vertical",
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar.ProgressBarTooltip, {
          position: "before"
        })
      }));
      var actual = _react.screen.getByRole('progressbar').children.item(1);
      var expected = 'before';
      expect(actual).toHaveClass(expected);
    });
    test('should have tooltip with `left` className when position is set to `left`', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
        orientation: "vertical",
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar.ProgressBarTooltip, {
          position: "left"
        })
      }));
      var actual = _react.screen.getByRole('progressbar').children.item(1);
      var expected = 'left';
      expect(actual).toHaveClass(expected);
    });
    test('should have tooltip with `right` className when position is set to `right`', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
        orientation: "vertical",
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar.ProgressBarTooltip, {
          position: "right"
        })
      }));
      var actual = _react.screen.getByRole('progressbar').children.item(1);
      var expected = 'right';
      expect(actual).toHaveClass(expected);
    });
    test('should have tooltip with default `after` className when no position is set', function () {
      (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
        orientation: "vertical",
        children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar.ProgressBarTooltip, {})
      }));
      var actual = _react.screen.getByRole('progressbar').children.item(1);
      var expected = 'after';
      expect(actual).toHaveClass(expected);
    });
  });
});