"use strict";

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

var _react = require("react");

var _testUtils = _interopRequireDefault(require("react-dom/test-utils"));

var _immutable = require("immutable");

var _Button = _interopRequireDefault(require("@instructure/ui-buttons/lib/components/Button"));

var _dndTestUtils = require("../../../../../../../tests/util/dndTestUtils");

var _mouseEventOn = _interopRequireDefault(require("../../../../../../../tests/util/mouseEventOn"));

var _AddToBankModal = _interopRequireDefault(require("../../../../../../banks/components/AddToBankModal"));

var _index = _interopRequireDefault(require("../index"));

var _presenter = _interopRequireDefault(require("../presenter"));

var _Footer = _interopRequireDefault(require("../Footer"));

var _Header = _interopRequireDefault(require("../Header"));

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

var _QuizEntry = _interopRequireDefault(require("../../../../../../common/records/QuizEntry"));

var _Bank = _interopRequireDefault(require("../../../../../../common/records/Bank"));

var _QuizEntry2 = require("../../../../../../../tests/factories/QuizEntry");

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

describe('QuizEntryEdit', function () {
  var sandbox = sinon.createSandbox();
  var QuizEntryEditWithContext = withContext((0, _dndTestUtils.wrapInDragAndDropTestContext)(_presenter.default));
  var changeItemTitleStub = sandbox.stub();
  var changeQuizEntryEntryStub = sandbox.stub();
  var changeQuizEntryPointsStub = sandbox.stub();
  var clearModificationsStub = sandbox.stub();
  var clearNextQuizEntryStub = sandbox.stub();
  var clearTemporaryItemStub = sandbox.stub();
  var cloneQuizEntryStub = sandbox.stub();
  var createItemStub = sandbox.stub();
  var createTempStimulusStub = sandbox.stub();
  var createQuizEntryStub = sandbox.stub();
  var hideErrorStub = sandbox.stub();
  var moveQuizEntryStub = sandbox.stub();
  var moveTemporaryQuizEntryStub = sandbox.stub();
  var openModalStub = sandbox.stub();
  var openRegradeModalStub = sandbox.stub();
  var removeQuizEntryStub = sandbox.stub();
  var screenreaderNotificationStub = sandbox.stub();
  var setUiStub = sandbox.stub();
  var showErrorStub = sandbox.stub();
  var switchOffEditingStub = sandbox.stub();
  var updateItemStub = sandbox.stub();
  var updateQuizEntryStub = sandbox.stub();
  var workingQuizEntry = new _QuizEntry.default({
    id: '55',
    pointsPossible: 3999
  });

  workingQuizEntry.isValid = function () {
    return true;
  };

  var quizEntry = new _QuizEntry.default({
    id: '55',
    entryType: 'Item',
    entryId: 66,
    pointsPossible: 12,
    position: 3
  });
  var quizEntry1 = new _QuizEntry.default({
    position: 1
  });
  var quizEntry2 = new _QuizEntry.default({
    position: 2
  });
  var quizEntry4 = new _QuizEntry.default({
    position: 4
  });
  var quizEntry5 = new _QuizEntry.default({
    position: 5
  });
  var quizEntries = (0, _immutable.List)([quizEntry1, quizEntry2, quizEntry, quizEntry4, quizEntry5]);
  var workingItem = new _Item.default({
    id: '1',
    properties: {
      varyPointsByAnswer: false
    }
  });

  workingItem.isValid = function () {
    return true;
  };

  workingItem.getErrors = function () {
    return (0, _immutable.fromJS)({});
  };

  workingItem.errorsFor = function () {
    return (0, _immutable.fromJS)({});
  };

  var item = new _Item.default({
    id: '66'
  });
  var defaultProps = {
    changeItemTitle: changeItemTitleStub,
    changeQuizEntryEntry: changeQuizEntryEntryStub,
    changeQuizEntryPoints: changeQuizEntryPointsStub,
    clearModifications: clearModificationsStub,
    clearNextQuizEntry: clearNextQuizEntryStub,
    clearTemporaryItem: clearTemporaryItemStub,
    cloneQuizEntry: cloneQuizEntryStub,
    createItem: createItemStub,
    createQuizEntry: createQuizEntryStub,
    createTempStimulus: createTempStimulusStub,
    hideError: hideErrorStub,
    moveQuizEntry: moveQuizEntryStub,
    moveTemporaryQuizEntry: moveTemporaryQuizEntryStub,
    openModal: openModalStub,
    openRegradeModal: openRegradeModalStub,
    removeQuizEntry: removeQuizEntryStub,
    screenreaderNotification: screenreaderNotificationStub,
    setUi: setUiStub,
    showError: showErrorStub,
    switchOffEditing: switchOffEditingStub,
    updateItem: updateItemStub,
    updateQuizEntry: updateQuizEntryStub,
    workingEntry: workingItem,
    workingQuizEntry: workingQuizEntry,
    disabledForRegrade: false,
    displayPosition: 3,
    entry: item,
    guid: 'guid123',
    isOccluded: false,
    moveToPosition: function moveToPosition() {},
    name: 'This Will Not Always Be An Interaction Type Name So Please Do Not Assume It Is',
    quizEntries: quizEntries,
    quizEntry: quizEntry,
    quizId: '99',
    withConfirm: function withConfirm() {},
    appContainer: '.root',
    onEditQuizEntryToggle: function onEditQuizEntryToggle() {}
  };
  var testbed = createTestbed(QuizEntryEditWithContext, defaultProps);
  sandbox.stub(item, 'getWorkingInstance');
  sandbox.stub(item, 'hasModifications');
  sandbox.stub(quizEntry, 'getWorkingInstance');
  sandbox.stub(workingQuizEntry, 'getEntry');
  sandbox.stub(workingQuizEntry, 'getItem');
  beforeEach(function () {
    createItemStub.resolves({
      id: '2'
    });
    createQuizEntryStub.resolves({
      id: '56'
    });
    updateItemStub.resolvesArg(0);
    updateQuizEntryStub.resolves();
    item.getWorkingInstance.returns(workingItem);
    item.hasModifications.returns(true);
    quizEntry.getWorkingInstance.returns(workingQuizEntry);
    workingQuizEntry.getEntry.returns(workingItem);
    workingQuizEntry.getItem.returns(workingItem);
  });
  afterEach(function () {
    sandbox.reset();
  });
  shouldRenderComponent(testbed, {}, QuizEntryEditWithContext);
  it('renders its child', function () {
    var childDiv = (0, _react.createElement)('div', {
      className: 'childClassname'
    }, 'child element');
    testbed.render({
      children: childDiv
    });
    var childComponent = testbed.findChildrenByClass('childClassname')[0];
    expect(childComponent).to.not.be.undefined();
  });
  it('renders the Footer', function () {
    testbed.render();
    expect(testbed.findChildByType(_Footer.default)).to.exist();
  });
  context('bank entry', function () {
    it('renders the Footer', function () {
      var _QuizEntryBankEntry = (0, _QuizEntry2.QuizEntryBankEntry)(),
          quizEntry = _QuizEntryBankEntry.quizEntry,
          entry = _QuizEntryBankEntry.entry;

      testbed.render({
        quizEntry: quizEntry,
        entry: entry
      });
      expect(testbed.findChildByType(_Footer.default)).to.exist();
    });
  });
  context('bank item footers', function () {
    it('does not render a footer', function () {
      var bankQuizEntry = new _QuizEntry.default({
        id: '55',
        entryType: 'Bank',
        entryId: 66,
        position: 3
      });
      var bankEntry = new _Bank.default();
      sandbox.stub(bankQuizEntry, 'getEntry').returns(bankEntry);

      bankQuizEntry.getWorkingInstance = function () {
        return bankQuizEntry;
      };

      bankEntry.getWorkingInstance = function () {
        return bankEntry;
      };

      testbed.render({
        quizEntry: bankQuizEntry
      });
      expect(testbed.findChildrenByType(_Footer.default)).to.be.empty();
    });
    it('does render a footer if "regrading"', function () {
      var bankQuizEntry = new _QuizEntry.default({
        id: '55',
        entryType: 'Bank',
        entryId: 66,
        position: 3
      });
      var bankEntry = new _Bank.default();
      sandbox.stub(bankQuizEntry, 'getEntry').returns(bankEntry);

      bankQuizEntry.getWorkingInstance = function () {
        return bankQuizEntry;
      };

      bankEntry.getWorkingInstance = function () {
        return bankEntry;
      };

      testbed.render({
        disabledForRegrade: true,
        quizEntry: bankQuizEntry
      });
      expect(testbed.findChildByType(_Footer.default)).to.exist();
    });
  });
  it('renders the Header', function () {
    testbed.render();
    expect(testbed.findChildByType(_Header.default)).to.exist();
  });
  describe('adding to item banks', function () {
    it('renders AddToBankModal', function () {
      testbed.render();
      expect(testbed.findChildByType(_AddToBankModal.default)).to.exist();
    });
    it('disables submit on continue if saving a new item', function () {
      testbed.render({
        workingQuizEntry: new _QuizEntry.default({
          entryType: 'Item',
          id: _constants.TEMPORARY_QUIZ_ENTRY_ID
        })
      });
      testbed.findChildByType(_AddToBankModal.default).props.onContinue();
      expect(testbed.findChildByType(_Footer.default).props.disableSubmit).to.be.true();
    });
    it('does not disable submit on continue if saving an existing item', function () {
      testbed.render();
      testbed.findChildByType(_AddToBankModal.default).props.onContinue();
      expect(testbed.findChildByType(_Footer.default).props.disableSubmit).to.be.false();
    });
    it('creates the entry for the bank if it does not exist', function () {
      testbed.render({
        entry: new _Item.default({
          id: _constants.TEMPORARY_ITEM_ID
        })
      });
      testbed.findChildByType(_AddToBankModal.default).props.getEntry();
      expect(updateItemStub).not.to.have.been.called();
      expect(createItemStub).to.have.been.called();
    });
    it('creates a copy of the entry if it has modifications and shouldClone is true', function () {
      testbed.render({
        shouldClone: true
      });
      testbed.findChildByType(_AddToBankModal.default).props.getEntry();
      expect(updateItemStub).not.to.have.been.called();
      expect(createItemStub).to.have.been.called();
    });
    it('updates the entry and returns it for the bank if it exists', function () {
      testbed.render();
      testbed.findChildByType(_AddToBankModal.default).props.getEntry();
      expect(createItemStub).not.to.have.been.called();
      expect(updateItemStub).to.have.been.called();
    });
    it('updates the quiz entry with freshly banked content', function () {
      var bankEntry = {
        id: '11'
      };
      testbed.render();
      testbed.findChildByType(_AddToBankModal.default).props.onAdd(bankEntry);
      expect(updateQuizEntryStub).to.have.been.calledWith('99', '55', {
        entryId: '11',
        entryType: 'BankEntry'
      });
    });
    it('clones the quiz entry if it was immutable', function () {
      testbed.render({
        shouldClone: true
      });
      testbed.findChildByType(_AddToBankModal.default).props.onAdd({
        id: '11'
      });
      expect(cloneQuizEntryStub).to.have.been.calledWith('99', '55', sinon.match({
        entry: {},
        entryEditable: true,
        entryId: '11',
        entryType: 'BankEntry',
        id: '55',
        pointsPossible: 3999,
        position: null,
        properties: {},
        regradeAdjustedPointsPossible: null,
        status: 'mutable',
        stimulusQuizEntryId: null
      }));
    });
    it('creates the temporary quiz entry with banked content', function () {
      var bankEntry = {
        id: '11'
      };
      testbed.render({
        workingQuizEntry: new _QuizEntry.default({
          entryType: 'Item',
          id: _constants.TEMPORARY_QUIZ_ENTRY_ID
        })
      });
      testbed.findChildByType(_AddToBankModal.default).props.onAdd(bankEntry);
      expect(createQuizEntryStub).to.have.been.calledWith('99', '11', 'BankEntry', sinon.match({
        points_possible: 1
      }));
    });
    it('clears modifications, temporary item for temporary quiz entry with banked content', function () {
      var bankEntry = {
        id: '11'
      };
      testbed.render({
        workingQuizEntry: new _QuizEntry.default({
          entryType: 'Item',
          id: _constants.TEMPORARY_QUIZ_ENTRY_ID
        })
      });
      testbed.findChildByType(_AddToBankModal.default).props.onAdd(bankEntry);
      expect(clearModificationsStub).to.have.been.calledWith('items', item.id);
      expect(clearTemporaryItemStub).to.have.been.calledWith(defaultProps.quizId);
      expect(switchOffEditingStub).to.have.been.called();
    });
  });
  context('unmounting', function () {
    it('sets the UI', function () {
      testbed.render();
      testbed.unmount();
      expect(setUiStub).to.have.been.calledWith(_constants.SHOULD_CLONE_ITEM, false);
    });
  });
  context('cancelling', function () {
    var cancel = function cancel() {
      var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      testbed.render(props);
      var button = testbed.findChildrenByTagName('button').find(function (b) {
        return b.innerText.includes('Cancel');
      });

      _testUtils.default.Simulate.click(button);
    };

    it('clears modifications', function () {
      cancel();
      expect(clearModificationsStub).to.have.been.calledWith('items', item.id);
      expect(clearModificationsStub).to.have.been.calledWith('quizEntries', quizEntry.id);
    });
    it('clears the temporary item if the quiz entry is temporary', function () {
      cancel({
        quizEntry: new _QuizEntry.default({
          id: _constants.TEMPORARY_QUIZ_ENTRY_ID,
          entry: _constants.TEMPORARY_ITEM_ID,
          entryType: 'Item'
        })
      });
      expect(clearTemporaryItemStub).to.have.been.calledWith(defaultProps.quizId);
    });
    it('does not clear the temporary item if the item is not temporary', function () {
      cancel();
      expect(clearTemporaryItemStub).to.have.not.been.called();
    });
  });
  context('submitting', function () {
    var shared = function shared(submit) {
      it('updates existing quiz entry and item', function (done) {
        submit();
        setTimeout(function () {
          expect(updateItemStub).to.have.been.calledWith(workingItem, defaultProps.quizId);
          expect(updateQuizEntryStub).to.have.been.calledWith(defaultProps.quizId, workingQuizEntry.id, sinon.match.any);
          expect(clearModificationsStub).to.have.been.called();
          done();
        });
      });
      it('creates temporary quiz entry and item', function (done) {
        var tempItem = item.set('id', _constants.TEMPORARY_ITEM_ID);
        var tempEntry = workingQuizEntry.set('id', _constants.TEMPORARY_QUIZ_ENTRY_ID);
        sandbox.stub(tempEntry, 'getEntry').returns(tempItem);
        sandbox.stub(tempEntry, 'getItem').returns(tempItem);

        tempEntry.isValid = function () {
          return true;
        };

        quizEntry.getWorkingInstance.returns(tempEntry);
        submit({
          workingQuizEntry: tempEntry,
          entry: tempItem
        });
        setTimeout(function () {
          expect(createItemStub).to.have.been.called();
          expect(createQuizEntryStub).to.have.been.called();
          expect(clearTemporaryItemStub).to.have.been.called();
          done();
        });
      });
      it('creates the next quiz entry when needed', function (done) {
        var tempItem = item.set('id', _constants.TEMPORARY_ITEM_ID);
        var tempEntry = workingQuizEntry.set('id', _constants.TEMPORARY_QUIZ_ENTRY_ID);
        sandbox.stub(tempEntry, 'getEntry').returns(tempItem);
        sandbox.stub(tempEntry, 'getItem').returns(tempItem);

        tempEntry.isValid = function () {
          return true;
        };

        quizEntry.getWorkingInstance.returns(tempEntry);
        submit({
          entry: tempItem,
          nextQuizEntry: (0, _immutable.Map)()
        });
        setTimeout(function () {
          expect(createTempStimulusStub).to.have.been.called();
          expect(clearNextQuizEntryStub).to.have.been.called();
          done();
        });
      });
      it('creates temporary quiz entry for existing item', function (done) {
        var tempEntry = workingQuizEntry.set('id', _constants.TEMPORARY_QUIZ_ENTRY_ID);

        tempEntry.isValid = function () {
          return true;
        };

        sandbox.stub(tempEntry, 'getEntry').returns(item);
        sandbox.stub(tempEntry, 'getItem').returns(item);
        quizEntry.getWorkingInstance.returns(tempEntry);
        submit({
          workingQuizEntry: tempEntry
        });
        setTimeout(function () {
          expect(createQuizEntryStub).to.have.been.called();
          expect(clearModificationsStub).to.have.been.called();
          done();
        });
      });
      context('when updating item fails', function () {
        it('re-enables button', function (done) {
          submit({
            updateItem: sandbox.stub().rejects()
          });
          setTimeout(function () {
            var button = testbed.findChildrenByTagName('button').find(function (b) {
              return b.innerText.includes('Done');
            });
            expect(button.disabled).to.be.false();
            done();
          });
        });
      });
      context('when creating item fails', function () {
        it('re-enables button', function (done) {
          var tempItem = item.set('id', _constants.TEMPORARY_ITEM_ID);
          var tempEntry = workingQuizEntry.set('id', _constants.TEMPORARY_QUIZ_ENTRY_ID);

          tempEntry.getEntry = function () {
            return tempItem;
          };

          tempEntry.getItem = function () {
            return tempItem;
          };

          tempEntry.isValid = function () {
            return true;
          };

          quizEntry.getWorkingInstance.returns(tempEntry);
          submit({
            createItem: sandbox.stub().rejects(),
            workingQuizEntry: tempEntry,
            entry: tempItem
          });
          setTimeout(function () {
            var button = testbed.findChildrenByTagName('button').find(function (b) {
              return b.innerText.includes('Done');
            });
            expect(button.disabled).to.be.false();
            done();
          });
        });
      });
      context('when updating quiz entry fails', function () {
        it('re-enables button', function (done) {
          submit({
            updateQuizEntry: sandbox.stub().rejects()
          });
          setTimeout(function () {
            var button = testbed.findChildrenByTagName('button').find(function (b) {
              return b.innerText.includes('Done');
            });
            expect(button.disabled).to.be.false();
            done();
          });
        });
      });
      context('when creating quiz entry fails', function () {
        it('re-enables button', function (done) {
          var tempItem = item.set('id', _constants.TEMPORARY_ITEM_ID);
          var tempEntry = workingQuizEntry.set('id', _constants.TEMPORARY_QUIZ_ENTRY_ID);

          tempEntry.getEntry = function () {
            return tempItem;
          };

          tempEntry.getItem = function () {
            return tempItem;
          };

          tempEntry.isValid = function () {
            return true;
          };

          quizEntry.getWorkingInstance.returns(tempEntry);
          submit({
            createQuizEntry: sandbox.stub().rejects(),
            workingQuizEntry: tempEntry,
            entry: tempItem
          });
          setTimeout(function () {
            var button = testbed.findChildrenByTagName('button').find(function (b) {
              return b.innerText.includes('Done');
            });
            expect(button.disabled).to.be.false();
            done();
          });
        });
      });
      context('should clone', function () {
        it('submits the item if it is temporary', function (done) {
          submit({
            shouldClone: true
          });
          setTimeout(function () {
            expect(createItemStub).to.have.been.calledWith(workingItem, '99', 'quiz', workingItem.id);
            expect(cloneQuizEntryStub).to.have.been.calledWith(defaultProps.quizId, workingQuizEntry.id, sinon.match({
              entryId: '2',
              pointsPossible: 3999,
              id: '55'
            }));
            done();
          });
        });
        context('when cloning fails', function () {
          it('re-enables button', function (done) {
            submit({
              shouldClone: true,
              cloneQuizEntry: sandbox.stub().rejects()
            });
            setTimeout(function () {
              var button = testbed.findChildrenByTagName('button').find(function (b) {
                return b.innerText.includes('Done');
              });
              expect(button.disabled).to.be.false();
              done();
            });
          });
        });
      });
    };

    var submitViaDoneButton = function submitViaDoneButton() {
      var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      testbed.render(props);
      var button = testbed.findChildrenByTagName('button').find(function (b) {
        return b.innerText.includes('Done');
      });

      _testUtils.default.Simulate.click(button);
    };

    var submitViaOutsideClick = function submitViaOutsideClick() {
      var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      testbed.render(props);
      var outerElement = document.createElement('div');
      outerElement.className = 'root';
      document.body.appendChild(outerElement);
      (0, _mouseEventOn.default)(outerElement, 'click');
    };

    context('via done button', function () {
      shared(submitViaDoneButton);
    });
    context('via outside click', function () {
      shared(submitViaOutsideClick);
    });
    it('calls the right things on invalid submit', function (done) {
      var tempItem = item.set('id', _constants.TEMPORARY_ITEM_ID);
      var tempEntry = workingQuizEntry.set('id', _constants.TEMPORARY_QUIZ_ENTRY_ID);
      sandbox.stub(tempEntry, 'getEntry').returns(tempItem);
      sandbox.stub(tempEntry, 'getItem').returns(tempItem);

      tempEntry.isValid = function () {
        return false;
      };

      quizEntry.getWorkingInstance.returns(tempEntry);
      submitViaOutsideClick({
        workingQuizEntry: tempEntry,
        entry: tempItem
      });
      setTimeout(function () {
        expect(clearNextQuizEntryStub).to.have.been.called();
        expect(showErrorStub).to.have.been.called();
        expect(screenreaderNotificationStub).to.have.been.called();
        done();
      });
    });
    it('disables the Done button when submitting via outside click', function (done) {
      submitViaOutsideClick();
      var doneButton = testbed.findChildrenByType(_Button.default).find(function (b) {
        return testbed.getText(b).includes('Done');
      });
      setTimeout(function () {
        expect(doneButton.props.disabled).to.be.true();
        done();
      });
    });
  });
  describe('click off', function () {
    var clickOffExamples = function clickOffExamples() {
      var makeFalseApp = function makeFalseApp() {
        return document.createElement('div');
      };

      var elementInApp = function elementInApp() {
        var outerElement = document.createElement('div');
        outerElement.className = 'root';
        var falseApp = makeFalseApp();
        falseApp.appendChild(outerElement);
        document.body.appendChild(falseApp);
        return outerElement;
      };

      it('calls submitHandler when clicked outside', function (done) {
        testbed.render();
        var outerElement = elementInApp();
        (0, _mouseEventOn.default)(outerElement, 'click');
        setTimeout(function () {
          expect(updateItemStub).to.have.been.called();
          done();
        });
      });
      it('does not call submitHandler when clicked outside and valid, but occluded', function (done) {
        testbed.render({
          isOccluded: true
        });
        var outerElement = elementInApp();
        (0, _mouseEventOn.default)(outerElement, 'click');
        setTimeout(function () {
          expect(updateItemStub).to.have.not.been.called();
          done();
        });
      });
      it('does not call clickedOutside if the element is the addContentPopover button', function (done) {
        testbed.render();
        var addContentButton = document.createElement('button');
        var outerElement = document.createElement('div');
        outerElement.className = 'AddContentPopover';
        var falseApp = makeFalseApp();
        outerElement.appendChild(addContentButton);
        falseApp.appendChild(outerElement);
        document.body.appendChild(falseApp);
        addContentButton.focus();
        (0, _mouseEventOn.default)(addContentButton, 'click');
        setTimeout(function () {
          expect(updateItemStub).to.have.not.been.called();
          outerElement.remove();
          done();
        });
      });
      it('ignores clicks outside the app', function (done) {
        testbed.render();
        var outsideElement = document.createElement('button');
        var falseApp = makeFalseApp();
        document.body.appendChild(falseApp);
        document.body.appendChild(outsideElement);
        (0, _mouseEventOn.default)(outsideElement, 'click');
        setTimeout(function () {
          expect(updateItemStub).to.have.not.been.called();
          outsideElement.remove();
          done();
        });
      });
      it('does not ignore clicks outside the app when an AddContentPopover is open', function (done) {
        testbed.render({
          addContentPopoverOpen: true
        });
        var outsideElement = document.createElement('button');
        var falseApp = makeFalseApp();
        document.body.appendChild(falseApp);
        document.body.appendChild(outsideElement);
        (0, _mouseEventOn.default)(outsideElement, 'click');
        setTimeout(function () {
          expect(updateItemStub).to.have.been.called();
          outsideElement.remove();
          done();
        });
      });
    };

    context('as an sdk and standalone app', function () {
      clickOffExamples();
    });
  });
  describe('a11y tests', function () {
    it('should meet a11y standards', function (done) {
      testbed.render();
      testbed.checkA11yStandards(done);
    });
  });
  describe('test with connect', function () {
    var connectedTestbed = createTestbed((0, _dndTestUtils.wrapInDragAndDropTestContext)(withContext(_index.default)), defaultProps);
    shouldRenderComponent(connectedTestbed, {}, _presenter.default);
  });
});