"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

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

var _redux = require("redux");

var _constants = require("@instructure/quiz-common/lib/constants");

var _reduxStore = _interopRequireDefault(require("../../../reduxStore"));

var alertActions = _interopRequireWildcard(require("../../actions/alerts"));

function createBoundActionCreators() {
  var dispatch = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _reduxStore.default.dispatch;
  return (0, _redux.bindActionCreators)(alertActions, dispatch);
}

describe('alertHelpers', function () {
  it('should trigger additional actions', function () {
    var dispatchSpy = sinon.spy();
    createBoundActionCreators(dispatchSpy).addError('message');
    expect(dispatchSpy).to.have.been.calledOnce();
    expect(dispatchSpy.firstCall.args[0].type).to.eq(_constants.ADD_ALERT);
  });
});