"use strict";

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

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

var _chai = require("chai");

var _InteractionType = _interopRequireDefault(require("quiz-interactions/lib/records/InteractionType"));

var _interactionTypeMetadata = require("../interactionTypeMetadata");

describe('interactionTypeMetadata', function () {
  var fakeInteractionType = function fakeInteractionType() {
    var slug = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'choice';
    var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    return new _InteractionType.default((0, _objectSpread2.default)({
      slug: slug
    }, params));
  };

  it('returns icon and translated name for known types', function () {
    var type = fakeInteractionType();
    var metadata = (0, _interactionTypeMetadata.interactionTypeMetadata)(type);
    (0, _chai.expect)(metadata.name).to.be.equal('Multiple Choice');
    (0, _chai.expect)(metadata.icon).to.not.be.undefined();
  });
  it('returns icon and translated name for known types', function () {
    var type = fakeInteractionType('unknown', {
      name: 'Unknown name'
    });
    var metadata = (0, _interactionTypeMetadata.interactionTypeMetadata)(type);
    (0, _chai.expect)(metadata.name).to.be.equal('Unknown name');
    (0, _chai.expect)(metadata.icon).to.not.be.undefined();
  });
});