aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/utils/util.spec.ts
blob: 2f9142f9ce21f3bb3630ec5e55c51127c7385b14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import {Utils} from "./utils";
import {TestBed} from "@angular/core/testing";


describe('Util', () => {
  let util: Utils;

  beforeAll(done => (async () => {
    TestBed.configureTestingModule({

    });
    await TestBed.compileComponents();

    util = new Utils();

  })().then(done).catch(done.fail));

  test('should be defined', () => {
    expect(util).toBeDefined();
  });

  test('hasContents should return false if object is undefined or null or empty', () => {
    expect(Utils.hasContents(undefined)).toBeFalsy();
    expect(Utils.hasContents(null)).toBeFalsy();
    expect(Utils.hasContents("")).toBeFalsy();
  });

  test('hasContents should return true if object is not undefined and not null and not empty', () => {
    expect(Utils.hasContents("someValue")).toBeTruthy();
  });
});