"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

describe('Spinner', function () {
  var testbed = createTestbed(_Spinner.default, {});
  shouldRenderComponent(testbed, {}, _Spinner.default);
  it('should render "Loading..." by default', function () {
    testbed.render();
    var text = testbed.getText();
    expect(text).to.include('Loading...');
  });
  it('should use mainText as screenreader text', function () {
    var mainText = 'Loading something important';
    var wrapper = testbed.renderShallowly({
      mainText: mainText
    });
    var spinner = wrapper.find('Spinner');
    expect(spinner.prop('title')).to.equal(mainText);
  });
  it('should render mainText if prop given', function () {
    var textProp = 'This is main text';
    testbed.render({
      mainText: textProp
    });
    var text = testbed.getText();
    expect(text).to.include(textProp);
  });
  describe('a11y tests', function () {
    it('should meet a11y standards', function (done) {
      testbed.render();
      testbed.checkA11yStandards(done);
    });
  });
});