"use strict";

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

var _reactDom = _interopRequireDefault(require("react-dom"));

var _renderAlerts = _interopRequireDefault(require("../renderAlerts"));

var _alerts = _interopRequireDefault(require("../../components/alerts"));

describe('renderAlerts', function () {
  var alert = document.createElement('div');
  alert.setAttribute('role', 'alert');
  alert.setAttribute('aria-live', 'assertive');
  beforeEach(function () {
    document.body.appendChild(alert);
    sinon.stub(_reactDom.default, 'render');
  });
  afterEach(function () {
    document.body.removeChild(alert);

    _reactDom.default.render.restore();
  });
  it('renders Alerts into the dom', function () {
    var store = {};
    (0, _renderAlerts.default)(store);
    expect(_reactDom.default.render.calledWithMatch({
      props: {
        children: {
          type: _alerts.default
        }
      }
    }, alert)).to.be.true();
  });
});