]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
a32e173678c91472b3a5f40c604b4ec75bd1ba3b
[ceph.git] /
1 import { NO_ERRORS_SCHEMA } from '@angular/core';
2 import { ComponentFixture, TestBed } from '@angular/core/testing';
3 import { ReactiveFormsModule } from '@angular/forms';
4
5 import { BsModalRef } from 'ngx-bootstrap/modal';
6
7 import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
8 import { OsdService } from '../../../../shared/api/osd.service';
9 import { JoinPipe } from '../../../../shared/pipes/join.pipe';
10 import { NotificationService } from '../../../../shared/services/notification.service';
11 import { OsdScrubModalComponent } from './osd-scrub-modal.component';
12
13 describe('OsdScrubModalComponent', () => {
14   let component: OsdScrubModalComponent;
15   let fixture: ComponentFixture<OsdScrubModalComponent>;
16
17   const fakeService = {
18     list: () => {
19       return new Promise(() => undefined);
20     },
21     scrub: () => {
22       return new Promise(() => undefined);
23     },
24     scrub_many: () => {
25       return new Promise(() => undefined);
26     }
27   };
28
29   configureTestBed({
30     imports: [ReactiveFormsModule],
31     declarations: [OsdScrubModalComponent, JoinPipe],
32     schemas: [NO_ERRORS_SCHEMA],
33     providers: [
34       BsModalRef,
35       JoinPipe,
36       { provide: OsdService, useValue: fakeService },
37       { provide: NotificationService, useValue: fakeService },
38       i18nProviders
39     ]
40   });
41
42   beforeEach(() => {
43     fixture = TestBed.createComponent(OsdScrubModalComponent);
44     component = fixture.componentInstance;
45     fixture.detectChanges();
46   });
47
48   it('should create', () => {
49     expect(component).toBeTruthy();
50   });
51 });