"use strict";

var _chai = require("chai");

var _quizzes = require("../quizzes");

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

describe('quizzes action creators', function () {
  it('returns a addQuizzes action ', function () {
    var quizzes = [{
      id: '1',
      title: 'test'
    }, {
      id: '2',
      title: 'test 2'
    }];
    var addQuizzesAction = (0, _quizzes.addQuizzes)(quizzes);
    var expectedAction = {
      type: _constants.ADD_QUIZZES,
      payload: quizzes
    };
    (0, _chai.expect)(addQuizzesAction).to.deep.equal(expectedAction);
  });
  it('returns a well-formed activeQuizId change action', function () {
    var newActiveQuizAction = (0, _quizzes.newActiveQuiz)('12');
    (0, _chai.expect)(newActiveQuizAction).to.deep.equal({
      type: _constants.ACTIVE_QUIZ_CHANGE,
      payload: '12'
    });
  });
  it('returns a proper disassociateQuizEntry action', function () {
    var disassocItemAction = (0, _quizzes.disassociateQuizEntry)('1', '2');
    var expectedAction = {
      type: _constants.DISASSOCIATE_QUIZ_ENTRY,
      payload: {
        quizId: '1',
        quizEntryId: '2'
      }
    };
    (0, _chai.expect)(disassocItemAction).to.deep.equal(expectedAction);
  });
});