"use strict";

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

var _immutable = require("immutable");

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

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

var _reduxStore = require("../../../../reduxStore");

var _featureCheck = require("../../../../common/util/featureCheck");

describe('connected BankEntryRow', function () {
  var fakeState = (0, _immutable.fromJS)({
    items: {
      1: {
        id: '1',
        itemBody: 'First entry'
      }
    }
  });
  var bankEntry = new _BankEntry.default({
    id: '123',
    updatedAt: new Date(),
    entryType: 'Item',
    entry: (0, _immutable.Map)({
      id: '1',
      schema: 'Item'
    })
  });
  var connectedTestbed = createTestbed(withContext(_index.default, {
    ui: {
      BANK_ENTRY_123_EXPANDED: true
    },
    tagAssociations: {
      'Item': {
        '1': [{
          id: '1',
          tag_id: '1',
          tag_value: 'tagme'
        }]
      }
    }
  }), {
    navigateToBankEntry: function navigateToBankEntry() {},
    bankEntry: bankEntry
  });
  before(function () {
    return (0, _reduxStore.setFakeStore)(fakeState);
  });
  after(function () {
    return (0, _reduxStore.unsetFakeStore)();
  });
  it('gets expanded state', function () {
    connectedTestbed.render();
    expect(connectedTestbed.getText()).to.include('Last Update');
  });
  describe('with tagging', function () {
    (0, _featureCheck.withTestFeatures)(['item_bank_tagging']);
    it('renders tags', function () {
      connectedTestbed.render();
      expect(connectedTestbed.getText()).to.include('tagme');
    });
  });
  describe('a11y tests', function () {
    it('should meet a11y standards', function (done) {
      connectedTestbed.render();
      connectedTestbed.checkA11yStandards(done);
    });
  });
});