"use strict";

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

var _immutable = require("immutable");

var _reactTestbed = _interopRequireDefault(require("../../../../../../../tests/util/react-testbed"));

var _withContext = _interopRequireDefault(require("../../../../../../../tests/util/withContext"));

var _Stimulus = _interopRequireDefault(require("../../../../../records/Stimulus"));

var _index = _interopRequireDefault(require("../index"));

var _QuizEntry = _interopRequireDefault(require("../../../../../records/QuizEntry"));

var styles = {
  componentId: 'bgqMF',
  template: function template(theme) {
    return "\n\n.StimulusShowInfo__styles__title {\n  font-weight: ".concat(theme.titleFontWeight || 'inherit', ";\n  font-size: ").concat(theme.titleFontSize || 'inherit', ";\n}\n\n.StimulusShowInfo__styles__instructions {\n  font-size: ").concat(theme.instructionFontSize || 'inherit', ";\n  padding: ").concat(theme.instructionsPadding || 'inherit', ";\n  margin-top: ").concat(theme.instructionsMargin || 'inherit', ";\n  background-color: ").concat(theme.instructionsBackgroundColor || 'inherit', ";\n}\n\n.StimulusShowInfo__styles__instructionsLabel {\n  font-weight: ").concat(theme.instructionsLabelFontWeight || 'inherit', ";\n  padding-bottom: ").concat(theme.instructionsLabelPadding || 'inherit', ";\n}\n\n.StimulusShowInfo__styles__body {\n}\n");
  },
  'title': 'StimulusShowInfo__styles__title',
  'instructions': 'StimulusShowInfo__styles__instructions',
  'instructionsLabel': 'StimulusShowInfo__styles__instructionsLabel',
  'body': 'StimulusShowInfo__styles__body'
};
describe('StimulusShowInfo', function () {
  var editingStub = sinon.stub();
  var openDeleteStimulusModalStub = sinon.stub();
  var stimulus = new _Stimulus.default({
    id: 55,
    title: 'Title',
    instructions: 'Instructions',
    body: '<em>Body</em>',
    sourceUrl: 'Source URL'
  });
  var defaultProps = {
    openDeleteStimulusModal: openDeleteStimulusModalStub,
    stimulus: stimulus,
    switchOnEditing: editingStub,
    connectDragSource: function connectDragSource(C) {
      return C;
    },
    quizEntries: (0, _immutable.fromJS)([new _QuizEntry.default(), new _QuizEntry.default()]),
    quizEntry: new _QuizEntry.default()
  };
  var testbed = (0, _reactTestbed.default)((0, _withContext.default)(_index.default), defaultProps);
  afterEach(function () {
    editingStub.resetHistory();
    openDeleteStimulusModalStub.resetHistory();
  });
  it('renders the body as html', function () {
    testbed.render();
    var elem = testbed.findChildrenByClass(styles.body)[0];
    expect(elem.innerHTML).to.eq('<em>Body</em>');
  });
  describe('a11y tests', function () {
    it('should meet a11y standards', function (done) {
      testbed.render();
      testbed.checkA11yStandards(done, {
        ignores: ['label', 'label-title-only']
      });
    });
  });
});