'use strict';

var _chai;

function _load_chai() {
  return _chai = require('chai');
}

var _bitId;

function _load_bitId() {
  return _bitId = require('../../src/bit-id');
}

describe('Bit-id', function () {
  describe('getValidBitId', function () {
    it('should convert CSSComp to css-comp', function () {
      var bitName = 'CSSComp';
      (0, (_chai || _load_chai()).expect)((_bitId || _load_bitId()).BitId.getValidBitId('global', bitName).toString()).to.equal('global/css-comp');
    }).timeout(5000);
    it('should convert EN-US to en-us', function () {
      var bitName = 'EN-US';
      (0, (_chai || _load_chai()).expect)((_bitId || _load_bitId()).BitId.getValidBitId('global', bitName).toString()).to.equal('global/en-us');
    });
    it('should convert AppBar to app-bar', function () {
      var bitName = 'AppBar';
      (0, (_chai || _load_chai()).expect)((_bitId || _load_bitId()).BitId.getValidBitId('global', bitName).toString()).to.equal('global/app-bar');
    });
    it('should convert app-bar to app-bar', function () {
      var bitName = 'app-bar';
      (0, (_chai || _load_chai()).expect)((_bitId || _load_bitId()).BitId.getValidBitId('global', bitName).toString()).to.equal('global/app-bar');
    });
    it('should convert app-Bar to app-bar', function () {
      var bitName = 'app-Bar';
      (0, (_chai || _load_chai()).expect)((_bitId || _load_bitId()).BitId.getValidBitId('global', bitName).toString()).to.equal('global/app-bar');
    });
    it('should convert App-Bar to app-bar', function () {
      var bitName = 'App-Bar';
      (0, (_chai || _load_chai()).expect)((_bitId || _load_bitId()).BitId.getValidBitId('global', bitName).toString()).to.equal('global/app-bar');
    });
    it('should convert CSScomp to cs-scomp ', function () {
      var bitName = 'CSScomp';
      (0, (_chai || _load_chai()).expect)((_bitId || _load_bitId()).BitId.getValidBitId('global', bitName).toString()).to.equal('global/cs-scomp');
    });
    it('should convert CSS@comp/CSScomp to css@comp/cs-scomp ', function () {
      var bitName = 'CSScomp';
      var global = 'CSS@comp';
      (0, (_chai || _load_chai()).expect)((_bitId || _load_bitId()).BitId.getValidBitId(global, bitName).toString()).to.equal('css@comp/cs-scomp');
    });
    it('should convert CSS!!####@comp/app-Bar to app-Bar', function () {
      var bitName = 'app-Bar';
      var global = 'CSS!!####@comp';
      (0, (_chai || _load_chai()).expect)((_bitId || _load_bitId()).BitId.getValidBitId(global, bitName).toString()).to.equal('css!!####@comp/app-bar');
    });
  });
  describe('toString', function () {
    it('should not contain the version as latest', function () {
      var bitId = (_bitId || _load_bitId()).BitId.parse('bit.envs/mocha/react@latest');
      (0, (_chai || _load_chai()).expect)(bitId.toString()).to.equal('bit.envs/mocha/react');
    });
  });
});