'use strict';

var _chai;

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

var _hasWildcard;

function _load_hasWildcard() {
  return _hasWildcard = _interopRequireDefault(require('./has-wildcard'));
}

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

describe('hasWildcard', function () {
  describe('using string', function () {
    it('should return true when an id has asterisks', function () {
      (0, (_chai || _load_chai()).expect)((0, (_hasWildcard || _load_hasWildcard()).default)('my/id/*')).to.be.true;
    });
    it('should return false when an id does not have asterisks', function () {
      (0, (_chai || _load_chai()).expect)((0, (_hasWildcard || _load_hasWildcard()).default)('my/id/')).to.be.false;
    });
    it('should return false when an id is undefined', function () {
      (0, (_chai || _load_chai()).expect)((0, (_hasWildcard || _load_hasWildcard()).default)(undefined)).to.be.false;
    });
    it('should return false when an id is null', function () {
      (0, (_chai || _load_chai()).expect)((0, (_hasWildcard || _load_hasWildcard()).default)(null)).to.be.false;
    });
  });
  describe('using an array of strings', function () {
    it('should return true when one of the items has wildcard', function () {
      (0, (_chai || _load_chai()).expect)((0, (_hasWildcard || _load_hasWildcard()).default)(['first/id', 'second/id*'])).to.be.true;
    });
    it('should return false when all of the items do not have wildcard', function () {
      (0, (_chai || _load_chai()).expect)((0, (_hasWildcard || _load_hasWildcard()).default)(['first/id', 'second/id', 'third/id'])).to.be.false;
    });
    it('should return false when items are undefined or null', function () {
      (0, (_chai || _load_chai()).expect)((0, (_hasWildcard || _load_hasWildcard()).default)([undefined, null])).to.be.false;
    });
  });
});