blob: 21ac2712de39d4934db1fc280fb82572d3bbd6df [file] [log] [blame]
AviZi280f8012017-06-09 02:39:56 +03001/*!
Michael Landoefa037d2017-02-19 12:57:33 +02002 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
AviZi280f8012017-06-09 02:39:56 +03003 *
Michael Landoefa037d2017-02-19 12:57:33 +02004 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
AviZi280f8012017-06-09 02:39:56 +03007 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
Michael Landoefa037d2017-02-19 12:57:33 +020010 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
AviZi280f8012017-06-09 02:39:56 +030012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
13 * or implied. See the License for the specific language governing
14 * permissions and limitations under the License.
Michael Landoefa037d2017-02-19 12:57:33 +020015 */
Michael Landoefa037d2017-02-19 12:57:33 +020016import uuid from 'src/nfvo-utils/UUID.js';
AviZi280f8012017-06-09 02:39:56 +030017
Michael Landoefa037d2017-02-19 12:57:33 +020018
19describe('UUID', () => {
20
21 it('function does exist', () => {
AviZi280f8012017-06-09 02:39:56 +030022 expect(uuid).toBeTruthy();
Michael Landoefa037d2017-02-19 12:57:33 +020023 });
24
25 it('generate UUID synchronously', () => {
26 let result = uuid(undefined, true);
AviZi280f8012017-06-09 02:39:56 +030027 expect(result).toBeTruthy();
Michael Landoefa037d2017-02-19 12:57:33 +020028 });
29
30 it('generate UUID synchronously with number', () => {
31 let result = uuid(5, true);
AviZi280f8012017-06-09 02:39:56 +030032 expect(result).toBeTruthy();
Michael Landoefa037d2017-02-19 12:57:33 +020033 });
34
35 it('generate UUID synchronously with number', () => {
36 let result = uuid(1, true);
AviZi280f8012017-06-09 02:39:56 +030037 expect(result).toBeTruthy();
Michael Landoefa037d2017-02-19 12:57:33 +020038 });
39
40 it('generate UUID asynchronously', done => {
41 uuid().then(result => {
AviZi280f8012017-06-09 02:39:56 +030042 expect(result).toBeTruthy();
Michael Landoefa037d2017-02-19 12:57:33 +020043 done();
44 });
45 });
46
47});