"use strict";

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

var _enzyme = require("enzyme");

var _Spinner = _interopRequireDefault(require("../Spinner"));

var _SpinnerModule = _interopRequireDefault(require("../Spinner.module.css"));

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

describe('Spinner Specs', function () {
  test('should have transparentBackground class when transparent prop equals true', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner["default"], {
      transparent: true
    }));
    var expected = true;
    var actual = subject.find('SpinnerCore').hasClass(_SpinnerModule["default"].transparentBackground);
    expect(actual).toBe(expected);
  });
  test('should center the Spinner when centered prop equals true', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner["default"], {
      centered: true
    }));
    var expected = 'centered';
    var actual = subject.find('SpinnerCore').prop('className');
    expect(actual).toContain(expected);
  });
  test('should have pausedAnimation class when paused prop equals true', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner["default"], {
      paused: true
    }));
    var expected = true;
    var actual = subject.find('SpinnerCore').hasClass(_SpinnerModule["default"].pausedAnimation);
    expect(actual).toBe(expected);
  });
  test('should have loading class when type prop equals `loading`', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner["default"], {
      type: "loading"
    }));
    var expected = 'loading';
    var actual = subject.find('SpinnerCore').prop('type');
    expect(actual).toBe(expected);
  });
  test('should have smallest class when size prop equals `smallest`', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner["default"], {
      size: "smallest"
    }));
    var expected = 'smallest';
    var actual = subject.find('SpinnerCore').prop('className');
    expect(actual).toContain(expected);
  });
  test('should have small class when size prop equals `small`', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner["default"], {
      size: "small"
    }));
    var expected = 'small';
    var actual = subject.find('SpinnerCore').prop('className');
    expect(actual).toContain(expected);
  });
  test('should have large class by default', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner["default"], {}));
    var expected = 'large';
    var actual = subject.find('SpinnerCore').prop('className');
    expect(actual).toContain(expected);
  });
  test('should have huge class when size prop equals `huge`', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner["default"], {
      size: "huge"
    }));
    var expected = 'huge';
    var actual = subject.find('SpinnerCore').prop('className');
    expect(actual).toContain(expected);
  });
  test('should have dark class when color prop equals `dark`', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner["default"], {
      color: "dark"
    }));
    var expected = 'dark';
    var actual = subject.find('SpinnerCore').prop('className');
    expect(actual).toContain(expected);
  });
  test('should set role to alert by default', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner["default"], {}));
    var expected = 'alert';
    var actual = subject.find("div.".concat(_SpinnerModule["default"].spinner)).prop('role');
    expect(actual).toBe(expected);
  });
  test('should set aria-live to off by default', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner["default"], {}));
    var expected = 'off';
    var actual = subject.find("div.".concat(_SpinnerModule["default"].spinner)).prop('aria-live');
    expect(actual).toBe(expected);
  });
});