"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

function _chai() {
  const data = require("chai");

  _chai = function () {
    return data;
  };

  return data;
}

function _hasWildcard() {
  const data = _interopRequireDefault(require("./has-wildcard"));

  _hasWildcard = function () {
    return data;
  };

  return data;
}

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