"use strict";

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

var _immutable = require("immutable");

var _Errors = _interopRequireDefault(require("../Errors"));

var styles = {
  componentId: 'fvxaa',
  template: function template(theme) {
    return "\n\n.errors__styles__errors {\n  display: flex;\n  align-items: flex-start;\n  flex-direction: column;\n}\n\n.errors__styles__error {\n  font-size: ".concat(theme.errorFontSize || 'inherit', ";\n  color: ").concat(theme.errorColor || 'inherit', ";\n  flex: 1 1 auto;\n}\n");
  },
  'errors': 'errors__styles__errors',
  'error': 'errors__styles__error'
};
describe('Errors', function () {
  var testbed = createTestbed(_Errors.default, {
    errorList: (0, _immutable.List)(['something is wrong', 'something else is wrong'])
  });
  shouldRenderComponent(testbed, {}, _Errors.default);
  describe('rendering', function () {
    it('should render a list of errors', function () {
      testbed.render({});
      var individualErrors = testbed.findChildrenByClass(styles.error);
      expect(individualErrors.length).to.be.equal(2);
    });
    it('should not render if no errors are given', function () {
      testbed.render({
        errorList: (0, _immutable.List)()
      });
      var errorWrapper = testbed.findChildrenByClass(styles.errors)[0];
      expect(errorWrapper).to.be.undefined();
      var individualErrors = testbed.findChildrenByClass(styles.error);
      expect(individualErrors.length).to.be.equal(0);
    });
  });
  describe('a11y tests', function () {
    it('should meet a11y standards', function (done) {
      testbed.render({});
      testbed.checkA11yStandards(done);
    });
  });
});