'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var chai_js = require('aegir/utils/chai.js');
var mocha = require('../../utils/mocha.js');

function testList(factory, options) {
  const describe = mocha.getDescribe(options);
  const it = mocha.getIt(options);
  describe('.config.profiles.list', function () {
    this.timeout(30 * 1000);
    let ipfs;
    before(async () => {
      ipfs = (await factory.spawn()).api;
    });
    after(() => factory.clean());
    it('should list config profiles', async () => {
      const profiles = await ipfs.config.profiles.list();
      chai_js.expect(profiles).to.be.an('array');
      chai_js.expect(profiles).not.to.be.empty();
      profiles.forEach(profile => {
        chai_js.expect(profile.name).to.be.a('string');
        chai_js.expect(profile.description).to.be.a('string');
      });
    });
  });
}

exports.testList = testList;
