summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/components/spinner/spinner.component.spec.ts
blob: 531ee8c62fa426a751c595fbec95e4cc99028e3e (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
32
33
34
35
36
37
38
39
40
41
42
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {HttpClientTestingModule} from '@angular/common/http/testing';
import { SpinnerComponent } from './spinner.component';

describe('Spinner component', () => {
  let component: SpinnerComponent;
  let fixture: ComponentFixture<SpinnerComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [HttpClientTestingModule],
      providers: [],
      declarations: [SpinnerComponent ]
    })
      .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(SpinnerComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('component should be defined', () => {
    expect(component).toBeDefined();
  });


  it('component constructor should subscribe of showSpinner event with true', ()=> {
    SpinnerComponent.showSpinner.next(true);
    expect(component.show).toBeTruthy();
  });

  it('component constructor should subscribe of showSpinner event with false', ()=> {
    SpinnerComponent.showSpinner.next(false);
    expect(component.show).toBeFalsy();
  });




});