"use strict";

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

var _immutable = require("immutable");

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

var _BankEntry = _interopRequireDefault(require("../../../../common/records/BankEntry"));

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

var _BankEntryRow = _interopRequireDefault(require("../../BankEntryRow"));

describe('BankEntriesList', function () {
  var navigateToBankEntryStub = sinon.stub();
  var bankEntries = (0, _immutable.List)([new _BankEntry.default({
    entry: new _Item.default({
      id: 1,
      itemBody: 'First entry'
    })
  }), new _BankEntry.default({
    entry: new _Item.default({
      id: 2,
      itemBody: 'Second item'
    })
  })]);
  var testbed = createTestbed(_presenter.default, {
    bankEntries: bankEntries,
    navigateToBankEntry: navigateToBankEntryStub
  });
  it('renders bank entries', function () {
    var output = testbed.renderShallowly();
    var rows = output.find(_BankEntryRow.default);
    expect(rows.length).to.eq(2);
  });
  it('navigates to bank entry', function () {
    var output = testbed.renderShallowly();
    var rows = output.find(_BankEntryRow.default);
    rows.first().props().navigateToBankEntry();
    expect(navigateToBankEntryStub).to.be.calledOnce();
  });
});