"use strict";

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

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

describe('connected Bank', function () {
  var connectedTestbed = createTestbed(withContext(_index.default, {
    banks: {
      1: {
        title: 'Very distinctive name',
        updatedAt: Date.now()
      }
    },
    bankSearch: {
      interactionTypes: []
    },
    qtiImports: {}
  }), {
    bankId: '1',
    isCompact: true,
    navigateToBanks: function navigateToBanks() {},
    navigateToBankEntry: function navigateToBankEntry() {}
  });
  var fetchStub = sinon.stub();
  useFakeFetching({
    dispatchStub: sinon.stub(),
    getStateStub: sinon.stub(),
    fetchStub: fetchStub
  });
  it('fetches bank on mount', function () {
    connectedTestbed.render();
    expect(fetchStub).to.have.been.calledWith('/api/banks/1');
  });
  it('finds bank in store', function () {
    connectedTestbed.render();
    expect(connectedTestbed.getText()).to.include('Very distinctive name');
  });
});