]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
cf08843c263f13dbb6f54bb01fb187dfb0c3a1b3
[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 { 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],
31     schemas: [NO_ERRORS_SCHEMA],
32     providers: [
33       BsModalRef,
34       { provide: OsdService, useValue: fakeService },
35       { provide: NotificationService, useValue: fakeService },
36       i18nProviders
37     ]
38   });
39
40   beforeEach(() => {
41     fixture = TestBed.createComponent(OsdScrubModalComponent);
42     component = fixture.componentInstance;
43     fixture.detectChanges();
44   });
45
46   it('should create', () => {
47     expect(component).toBeTruthy();
48   });
49 });