blob: 2f9142f9ce21f3bb3630ec5e55c51127c7385b14 [file] [log] [blame]
Ittay Stern6f900cc2018-08-29 17:01:32 +03001import {Utils} from "./utils";
2import {TestBed} from "@angular/core/testing";
3
4
5describe('Util', () => {
6 let util: Utils;
7
8 beforeAll(done => (async () => {
9 TestBed.configureTestingModule({
10
11 });
12 await TestBed.compileComponents();
13
14 util = new Utils();
15
16 })().then(done).catch(done.fail));
17
18 test('should be defined', () => {
19 expect(util).toBeDefined();
20 });
21
22 test('hasContents should return false if object is undefined or null or empty', () => {
23 expect(Utils.hasContents(undefined)).toBeFalsy();
24 expect(Utils.hasContents(null)).toBeFalsy();
25 expect(Utils.hasContents("")).toBeFalsy();
26 });
27
28 test('hasContents should return true if object is not undefined and not null and not empty', () => {
29 expect(Utils.hasContents("someValue")).toBeTruthy();
30 });
31});