]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-reweight-modal/osd-reweight-modal.component.spec.ts
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / cluster / osd / osd-reweight-modal / osd-reweight-modal.component.spec.ts
index 78c3860c5e39bd2b3d53fe1823abb778c64e7292..41e05021efc6a101ce379f21ce7db5c9d78b48c8 100644 (file)
@@ -1,17 +1,18 @@
 import { HttpClientTestingModule } from '@angular/common/http/testing';
+import { NO_ERRORS_SCHEMA } from '@angular/core';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { ReactiveFormsModule } from '@angular/forms';
 import { RouterTestingModule } from '@angular/router/testing';
 
-import { BsModalRef } from 'ngx-bootstrap/modal';
+import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import { of } from 'rxjs';
 
-import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
-import { OsdService } from '../../../../shared/api/osd.service';
-import { BackButtonComponent } from '../../../../shared/components/back-button/back-button.component';
-import { ModalComponent } from '../../../../shared/components/modal/modal.component';
-import { SubmitButtonComponent } from '../../../../shared/components/submit-button/submit-button.component';
-import { CdFormBuilder } from '../../../../shared/forms/cd-form-builder';
+import { OsdService } from '~/app/shared/api/osd.service';
+import { BackButtonComponent } from '~/app/shared/components/back-button/back-button.component';
+import { ModalComponent } from '~/app/shared/components/modal/modal.component';
+import { SubmitButtonComponent } from '~/app/shared/components/submit-button/submit-button.component';
+import { CdFormBuilder } from '~/app/shared/forms/cd-form-builder';
+import { configureTestBed } from '~/testing/unit-test-helper';
 import { OsdReweightModalComponent } from './osd-reweight-modal.component';
 
 describe('OsdReweightModalComponent', () => {
@@ -26,7 +27,8 @@ describe('OsdReweightModalComponent', () => {
       SubmitButtonComponent,
       BackButtonComponent
     ],
-    providers: [OsdService, BsModalRef, CdFormBuilder, i18nProviders]
+    schemas: [NO_ERRORS_SCHEMA],
+    providers: [OsdService, NgbActiveModal, CdFormBuilder]
   });
 
   beforeEach(() => {
@@ -43,7 +45,9 @@ describe('OsdReweightModalComponent', () => {
     component.osdId = 1;
     component.reweightForm.get('weight').setValue(0.5);
 
-    const osdServiceSpy = spyOn(TestBed.get(OsdService), 'reweight').and.callFake(() => of(true));
+    const osdServiceSpy = spyOn(TestBed.inject(OsdService), 'reweight').and.callFake(() =>
+      of(true)
+    );
     component.reweight();
 
     expect(osdServiceSpy.calls.count()).toBe(1);