"use strict";

var _chai = require("chai");

var _editing = require("../editing");

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

describe('editing action creators', function () {
  it('returns a well-formed start edit action', function () {
    var startEditAction = (0, _editing.startEdit)('someUniqKey');
    (0, _chai.expect)(startEditAction).to.deep.equal({
      type: _constants.START_EDIT,
      componentId: 'someUniqKey',
      initialFocusId: null
    });
  });
  it('returns a well-formed start edit action with initial focus id', function () {
    var startEditAction = (0, _editing.startEdit)('someUniqKey', 'initial_focus_id');
    (0, _chai.expect)(startEditAction).to.deep.equal({
      type: _constants.START_EDIT,
      componentId: 'someUniqKey',
      initialFocusId: 'initial_focus_id'
    });
  });
  it('returns a well-formed end edit action', function () {
    var endEditAction = (0, _editing.endEdit)('someOtherUniqKey');
    (0, _chai.expect)(endEditAction).to.deep.equal({
      type: _constants.END_EDIT,
      componentId: 'someOtherUniqKey'
    });
  });
  it('returns a well-formed toggle edit action', function () {
    var endEditAction = (0, _editing.toggleEditing)('someOtherUniqKey');
    (0, _chai.expect)(endEditAction).to.deep.equal({
      type: _constants.TOGGLE_EDIT,
      componentId: 'someOtherUniqKey'
    });
  });
});