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