"use strict";

var _react = _interopRequireDefault(require("react"));

var _enzyme = require("enzyme");

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

var _Spinner2 = _interopRequireDefault(require("../Spinner.less"));

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

describe('Spinner Specs', function () {
  it('should have not have client node when Spinner has no children', function () {
    var spinner = (0, _enzyme.mount)(_react.default.createElement(_Spinner.default, null));
    var expected = false;
    var actual = spinner.find("div.".concat(_Spinner2.default.client)).exists();
    expect(actual).to.equal(expected);
  });
  it('should have a client node when Spinner has children', function () {
    var spinner = (0, _enzyme.mount)(_react.default.createElement(_Spinner.default, null, "Loading..."));
    var expected = true;
    var actual = spinner.find("div.".concat(_Spinner2.default.client)).exists();
    expect(actual).to.equal(expected);
  });
  it('should have content class when Spinner has children', function () {
    var spinner = (0, _enzyme.mount)(_react.default.createElement(_Spinner.default, null, "Loading..."));
    var expected = true;
    var actual = spinner.find("div.".concat(_Spinner2.default.spinner)).hasClass(_Spinner2.default.content);
    expect(actual).to.equal(expected);
  });
  it('should have transparent class when transparent prop equals true', function () {
    var spinner = (0, _enzyme.mount)(_react.default.createElement(_Spinner.default, {
      transparent: true
    }, "Loading..."));
    var expected = true;
    var actual = spinner.find("div.".concat(_Spinner2.default.spinner)).hasClass(_Spinner2.default.transparent);
    expect(actual).to.equal(expected);
  });
  it('should set role to alert by default', function () {
    var spinner = (0, _enzyme.mount)(_react.default.createElement(_Spinner.default, null));
    var expected = 'alert';
    var actual = spinner.find("div.".concat(_Spinner2.default.spinner)).prop('role');
    expect(actual).to.equal(expected);
  });
  it('should set aria-live to off by default', function () {
    var spinner = (0, _enzyme.mount)(_react.default.createElement(_Spinner.default, null));
    var expected = 'off';
    var actual = spinner.find("div.".concat(_Spinner2.default.spinner)).prop('aria-live');
    expect(actual).to.equal(expected);
  });
});