]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
6d3402e04cae4fd06970ba269f72856072053f2b
[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 import { Observable } from 'rxjs';
6
7 import { CephfsService } from '../../../shared/api/cephfs.service';
8 import { SharedModule } from '../../../shared/shared.module';
9 import { CephfsClientsComponent } from './cephfs-clients.component';
10
11 describe('CephfsClientsComponent', () => {
12   let component: CephfsClientsComponent;
13   let fixture: ComponentFixture<CephfsClientsComponent>;
14
15   const fakeFilesystemService = {
16     getCephfs: (id) => {
17       return Observable.create((observer) => {
18         return () => console.log('disposed');
19       });
20     },
21     getClients: (id) => {
22       return Observable.create((observer) => {
23         return () => console.log('disposed');
24       });
25     }
26   };
27
28   beforeEach(async(() => {
29     TestBed.configureTestingModule({
30       imports: [RouterTestingModule, BsDropdownModule.forRoot(), SharedModule],
31       declarations: [CephfsClientsComponent],
32       providers: [{ provide: CephfsService, useValue: fakeFilesystemService }]
33     }).compileComponents();
34   }));
35
36   beforeEach(() => {
37     fixture = TestBed.createComponent(CephfsClientsComponent);
38     component = fixture.componentInstance;
39     fixture.detectChanges();
40   });
41
42   it('should create', () => {
43     expect(component).toBeTruthy();
44   });
45 });