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