{"size": 645, "ext": "js", "max_stars_repo_path": "app/test/list.test.js", "max_stars_repo_name": "markgreenwood/elasticsearch-console", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/test/list.test.js", "max_issues_repo_name": "markgreenwood/elasticsearch-console", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/test/list.test.js", "max_forks_repo_name": "markgreenwood/elasticsearch-console", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.875, "max_line_length": 77, "alphanum_fraction": 0.5720930233}
const expect = require('chai').expect;
const sinon = require('sinon');
const list = require('../lib/bank/handlers/list');

describe('list handler', () => {
  const client = { search: sinon.stub().resolves(new Array(10)) };

  const lister = list(client);

  it('list defaults to 10 records', () =>
    lister()
      .then((response) => {
        expect(client.search.calledOnce).to.be.true;
        expect(response.length).to.equal(10);
      })
  );

  it.skip('takes a size argument', () =>
    lister({ query: { size: 20 } })
      .then(() => {
        expect(client.search.calledWith({ query: { size: 20 } })).to.be.true;
      })
  );
});