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