]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
a4cc717023179ee9014230a75f6d7d0194d3cfb1
[ceph.git] /
1 import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 import { RouterTestingModule } from '@angular/router/testing';
3
4 import { BsDropdownModule } from 'ngx-bootstrap';
5
6 import { PerformanceCounterModule } from '../performance-counter.module';
7 import { TablePerformanceCounterService } from '../services/table-performance-counter.service';
8 import { PerformanceCounterComponent } from './performance-counter.component';
9
10 describe('PerformanceCounterComponent', () => {
11   let component: PerformanceCounterComponent;
12   let fixture: ComponentFixture<PerformanceCounterComponent>;
13
14   const fakeService = {
15     get: (service_type: string, service_id: string) => {
16       return new Promise(function(resolve, reject) {
17         return [];
18       });
19     },
20     list: () => {
21       return new Promise(function(resolve, reject) {
22         return {};
23       });
24     }
25   };
26
27   beforeEach(
28     async(() => {
29       TestBed.configureTestingModule({
30         imports: [
31           PerformanceCounterModule,
32           BsDropdownModule.forRoot(),
33           RouterTestingModule
34         ],
35         providers: [{ provide: TablePerformanceCounterService, useValue: fakeService }]
36       }).compileComponents();
37     })
38   );
39
40   beforeEach(() => {
41     fixture = TestBed.createComponent(PerformanceCounterComponent);
42     component = fixture.componentInstance;
43     fixture.detectChanges();
44   });
45
46   it('should create', () => {
47     expect(component).toBeTruthy();
48   });
49 });