"use strict";

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

var _immutable = require("immutable");

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

var _dragAndDrop = _interopRequireDefault(require("../dragAndDrop"));

describe('drag and drop reducer', function () {
  var nextStateEquals = function nextStateEquals(nextState, stateExpectations) {
    var nextStateImmutable = (0, _immutable.fromJS)(nextState);
    var stateExpectationsImmutable = (0, _immutable.fromJS)(stateExpectations);
    expect(nextStateImmutable.equals(stateExpectationsImmutable)).to.be.true();
  };

  it('should be able to set position', function () {
    var initialState = (0, _immutable.Map)();
    var action = {
      type: _constants.HOVER_POSITION,
      payload: {
        position: 2,
        aboveHalf: true,
        fromAbove: false
      }
    };
    nextStateEquals((0, _dragAndDrop.default)(initialState, action), {
      position: 2,
      aboveHalf: true,
      fromAbove: false
    });
  });
});