]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
185c525140402f82b7b09a91a32879268345d9da
[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';
6
7 import { OsdService } from '../../../../shared/api/osd.service';
8 import { NotificationService } from '../../../../shared/services/notification.service';
9 import { configureTestBed } from '../../../../shared/unit-test-helper';
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(function(resolve, reject) {
19         return {};
20       });
21     },
22     scrub: (data: any) => {
23       return new Promise(function(resolve, reject) {
24         return {};
25       });
26     },
27     scrub_many: (data: any) => {
28       return new Promise(function(resolve, reject) {
29         return {};
30       });
31     }
32   };
33
34   configureTestBed({
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   });
44
45   beforeEach(() => {
46     fixture = TestBed.createComponent(OsdScrubModalComponent);
47     component = fixture.componentInstance;
48     fixture.detectChanges();
49   });
50
51   it('should create', () => {
52     expect(component).toBeTruthy();
53   });
54 });