]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-restore-modal/rbd-trash-restore-modal.component.spec.ts
import 15.2.0 Octopus source
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / block / rbd-trash-restore-modal / rbd-trash-restore-modal.component.spec.ts
index caa6cf945eb3e32ac4b73bd155851593a7a4f36d..79d800279b4da55259a62c9fb60ce7c1dbd819ca 100644 (file)
@@ -1,4 +1,8 @@
-import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
+import {
+  HttpClientTestingModule,
+  HttpTestingController,
+  TestRequest
+} from '@angular/common/http/testing';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { ReactiveFormsModule } from '@angular/forms';
 import { RouterTestingModule } from '@angular/router/testing';
@@ -41,7 +45,7 @@ describe('RbdTrashRestoreModalComponent', () => {
     let httpTesting: HttpTestingController;
     let notificationService: NotificationService;
     let modalRef: BsModalRef;
-    let req;
+    let req: TestRequest;
 
     beforeEach(() => {
       httpTesting = TestBed.get(HttpTestingController);
@@ -49,7 +53,9 @@ describe('RbdTrashRestoreModalComponent', () => {
       modalRef = TestBed.get(BsModalRef);
 
       component.poolName = 'foo';
-      component.imageId = 'bar';
+      component.imageName = 'bar';
+      component.imageId = '113cb6963793';
+      component.ngOnInit();
 
       spyOn(modalRef, 'hide').and.stub();
       spyOn(component.restoreForm, 'setErrors').and.stub();
@@ -57,7 +63,7 @@ describe('RbdTrashRestoreModalComponent', () => {
 
       component.restore();
 
-      req = httpTesting.expectOne('api/block/image/trash/foo/bar/restore');
+      req = httpTesting.expectOne('api/block/image/trash/foo%2F113cb6963793/restore');
     });
 
     it('with success', () => {