"use strict";

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

var _immutable = require("immutable");

var _Item = _interopRequireDefault(require("../../../../common/records/Item"));

var _QuizSessionEvent = _interopRequireDefault(require("../../../../common/records/QuizSessionEvent"));

var _Event = _interopRequireDefault(require("../Event"));

var _ResponseEvent = _interopRequireDefault(require("../ResponseEvent"));

var _SessionStartEvent = _interopRequireDefault(require("../SessionStartEvent"));

describe('Event', function () {
  describe('for a response event', function () {
    // testrail test_id:  C2954598, C2954599
    var event = new _QuizSessionEvent.default({
      createdAt: '2016-09-28T18:45:27.700Z|232982772',
      eventType: 'RESPONSE'
    });
    var i = new _Item.default({
      interactionData: {
        choices: {}
      }
    });
    sinon.stub(event, 'getItem').returns(i);
    var testbed = createTestbed(_Event.default, {
      event: event,
      startTime: new Date()
    });
    shouldRenderComponent(testbed, {}, _Event.default);
    it('should render a ResponseEvent', function () {
      testbed.render();
      var responseEventComponent = testbed.findChildrenByType(_ResponseEvent.default)[0];
      expect(responseEventComponent).to.not.be.undefined();
    });
  });
  describe('for a session started/resumed event', function () {
    // testrail test_id: C2954596, C2954597
    var event = new _QuizSessionEvent.default((0, _immutable.fromJS)({
      createdAt: '2016-09-28T18:45:27.700Z|232982772',
      eventData: {},
      eventType: 'SESSION_STARTED_OR_RESUMED_EVENT'
    }));
    var testbed = createTestbed(_Event.default, {
      event: event,
      startTime: new Date()
    });
    shouldRenderComponent(testbed, {}, _Event.default);
    it('should render a SessionStartEvent', function () {
      testbed.render();
      var sessionStartEventComponent = testbed.findChildrenByType(_SessionStartEvent.default)[0];
      expect(sessionStartEventComponent).to.not.be.undefined();
    });
  });
});