"use strict";

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

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

var _chai = require("chai");

var _Edit = _interopRequireDefault(require("quiz-interactions/lib/components/multiple_answer/Edit"));

var _Show = _interopRequireDefault(require("quiz-interactions/lib/components/multiple_answer/Show"));

var _Take = _interopRequireDefault(require("quiz-interactions/lib/components/multiple_answer/Take"));

var _Result = _interopRequireDefault(require("quiz-interactions/lib/components/multiple_answer/Result"));

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

var _componentForItem = _interopRequireWildcard(require("../componentForItem"));

describe('componentForItem', function () {
  it('returns a show component if valid type and usage given', function () {
    var someComponent = (0, _componentForItem.default)('multi-answer', _constants.COMPONENT_SHOW);
    (0, _chai.expect)(someComponent).to.be.equal(_Show.default);
  });
  it('returns a taking component if valid type and usage given', function () {
    var someComponent = (0, _componentForItem.default)('multi-answer', _constants.COMPONENT_TAKE);
    (0, _chai.expect)(someComponent).to.be.equal(_Take.default);
  });
  it('returns an editing component if valid type and usage given', function () {
    var someComponent = (0, _componentForItem.default)('multi-answer', _constants.COMPONENT_EDIT);
    (0, _chai.expect)(someComponent).to.be.equal(_Edit.default);
  });
  it('returns an editing component if valid type and usage given', function () {
    var someComponent = (0, _componentForItem.default)('multi-answer', _constants.COMPONENT_RESULT);
    (0, _chai.expect)(someComponent).to.be.equal(_Result.default);
  });
  it('returns the unregistered component if invalid args given', function () {
    var someComponent = (0, _componentForItem.default)('foo', 'bar');
    (0, _chai.expect)(someComponent).to.be.equal(_componentForItem.UnregisteredItem);
  });
});