"use strict";

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

var actions = _interopRequireWildcard(require("../ui"));

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

describe('ui action creators', function () {
  describe('toggle', function () {
    it('returns a well-formed and correct action', function () {
      expect(actions.toggle('my_arbitrary_key')).to.deep.equal({
        type: _constants.TOGGLE_UI,
        payload: 'my_arbitrary_key'
      });
    });
  });
  describe('set', function () {
    it('returns a well-formed and correct action', function () {
      expect(actions.set('my_arbitrary_key', 'any_old_value')).to.deep.equal({
        type: _constants.SET_UI,
        payload: {
          key: 'my_arbitrary_key',
          value: 'any_old_value'
        }
      });
    });
  });
  describe('merge', function () {
    it('returns a well-formed and correct action', function () {
      expect(actions.merge('my_arbitrary_key', {
        itWill: 'probably be an object'
      })).to.deep.equal({
        type: _constants.MERGE_UI,
        payload: {
          key: 'my_arbitrary_key',
          value: {
            itWill: 'probably be an object'
          }
        }
      });
    });
  });
  describe('occludeQuizEntries', function () {
    it('returns a well-formed occludeQuizEntries action', function () {
      var occludeQuizEntriesAction = actions.occludeQuizEntries(true);
      expect(occludeQuizEntriesAction).to.deep.equal({
        type: _constants.OCCLUDE_QUIZ_ENTRIES,
        payload: true
      });
    });
  });
  describe('newActiveBankEntry', function () {
    it('returns a well-formed activeBankEntryId change action', function () {
      expect(actions.newActiveBankEntry('132')).to.deep.equal({
        type: _constants.ACTIVE_BANK_ENTRY_CHANGE,
        payload: '132'
      });
    });
  });
  describe('newActiveBank', function () {
    it('returns a well-formed activeBankId change action', function () {
      var newActiveBankAction = actions.newActiveBank('123');
      expect(newActiveBankAction).to.deep.equal({
        type: _constants.ACTIVE_BANK_CHANGE,
        payload: '123'
      });
    });
  });
  describe('setActiveCalculatorId', function () {
    it('returns a set ui field action', function () {
      var setActiveCalculatorIdAction = actions.setActiveCalculatorId('abc');
      expect(setActiveCalculatorIdAction).to.deep.equal({
        type: _constants.SET_UI,
        payload: {
          key: 'activeCalculatorId',
          value: 'abc'
        }
      });
    });
  });
});