'use strict';

const { expect, assert } = require('chai');

const projects = require('./projects');

describe('[csdr/config/config-utils] - getCsdrProject()', () => {

  it('should return null if project does not exist', () => {
    const prj = projects.getCsdrProject('UNKNOWN_PROJECT');
    expect(prj).to.be.undefined;
  })


  it('should return valid project details if project exists', () => {
    const prj = projects.getCsdrProject('my-workplace-host');
    expect(prj).not.to.be.null;
    expect(prj.name).to.equal('my-workplace-host');
    expect(prj.devopsMetadataFile).to.equal('app-my-workplace-host-build-metadata.json');
    expect(prj.devopsEnvsMetadataFile).to.equal('app-my-workplace-host-envs-metadata.json');
    expect(prj.devopsVersionsMetadataFile).to.equal('app-my-workplace-host-versions-metadata.json');
    expect(prj.devopsHistoryMetadataFile).to.equal('app-my-workplace-host-history-metadata.json');
  })
});
