]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
58d53ae4e1b052461da1acdcd84f02e79422d724
[ceph.git] /
1 import { Component, Input } from '@angular/core';
2 import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3
4 import { Observable } from 'rxjs/Observable';
5
6 import { PerformanceCounterService } from '../../../shared/api/performance-counter.service';
7 import { CdTableColumn } from '../../../shared/models/cd-table-column';
8 import { DimlessPipe } from '../../../shared/pipes/dimless.pipe';
9 import { FormatterService } from '../../../shared/services/formatter.service';
10 import { TablePerformanceCounterComponent } from './table-performance-counter.component';
11
12 @Component({ selector: 'cd-table', template: '' })
13 class TableStubComponent {
14   @Input() data: any[];
15   @Input() columns: CdTableColumn[];
16   @Input() autoReload: any = 5000;
17 }
18
19 describe('TablePerformanceCounterComponent', () => {
20   let component: TablePerformanceCounterComponent;
21   let fixture: ComponentFixture<TablePerformanceCounterComponent>;
22
23   const fakeService = {};
24
25   beforeEach(async(() => {
26     TestBed.configureTestingModule({
27       declarations: [TablePerformanceCounterComponent, TableStubComponent, DimlessPipe],
28       imports: [],
29       providers: [
30         { provide: PerformanceCounterService, useValue: fakeService },
31         DimlessPipe,
32         FormatterService
33       ]
34     }).compileComponents();
35   }));
36
37   beforeEach(() => {
38     fixture = TestBed.createComponent(TablePerformanceCounterComponent);
39     component = fixture.componentInstance;
40     fixture.detectChanges();
41   });
42
43   it('should create', () => {
44     expect(component).toBeTruthy();
45   });
46 });