blob: 531ee8c62fa426a751c595fbec95e4cc99028e3e [file] [log] [blame]
Sonsino, Ofir (os0695)ff76b5e2018-07-10 15:57:37 +03001import {async, ComponentFixture, TestBed} from '@angular/core/testing';
2import {HttpClientTestingModule} from '@angular/common/http/testing';
3import { SpinnerComponent } from './spinner.component';
4
5describe('Spinner component', () => {
6 let component: SpinnerComponent;
7 let fixture: ComponentFixture<SpinnerComponent>;
8
9 beforeEach(async(() => {
10 TestBed.configureTestingModule({
11 imports: [HttpClientTestingModule],
12 providers: [],
13 declarations: [SpinnerComponent ]
14 })
15 .compileComponents();
16 }));
17
18 beforeEach(() => {
19 fixture = TestBed.createComponent(SpinnerComponent);
20 component = fixture.componentInstance;
21 fixture.detectChanges();
22 });
23
24 it('component should be defined', () => {
25 expect(component).toBeDefined();
26 });
27
28
29 it('component constructor should subscribe of showSpinner event with true', ()=> {
30 SpinnerComponent.showSpinner.next(true);
31 expect(component.show).toBeTruthy();
32 });
33
34 it('component constructor should subscribe of showSpinner event with false', ()=> {
35 SpinnerComponent.showSpinner.next(false);
36 expect(component.show).toBeFalsy();
37 });
38
39
40
41
42});