]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-details/pool-details.component.spec.ts
import ceph 14.2.5
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / pool / pool-details / pool-details.component.spec.ts
index 7ee21b57e999d24a8ad632e7ba1cc0067823737e..4bf43944a140667bd44fb1c884ecf296838c75d8 100644 (file)
@@ -71,7 +71,7 @@ describe('PoolDetailsComponent', () => {
       expect(tabs[0].active).toBeTruthy();
     });
 
-    it('current active status of tabs should not change when selection is same with previour selection', () => {
+    it('current active status of tabs should not change when selection is the same as previous selection', () => {
       fixture.detectChanges();
       const tabs = poolDetailsComponent.tabsetChild.tabs;
       expect(tabs[0].active).toBeTruthy();
@@ -80,5 +80,23 @@ describe('PoolDetailsComponent', () => {
       fixture.detectChanges();
       expect(tabs[1].active).toBeTruthy();
     });
+
+    it('returns pool details correctly', () => {
+      const pool = { prop1: 1, cdIsBinary: true, prop2: 2, cdExecuting: true, prop3: 3 };
+      const expectedPool = { prop1: 1, prop2: 2, prop3: 3 };
+
+      expect(poolDetailsComponent.filterNonPoolData(pool)).toEqual(expectedPool);
+    });
+
+    it('pool data filtering is called', () => {
+      const filterNonPoolDataSpy = spyOn(
+        poolDetailsComponent,
+        'filterNonPoolData'
+      ).and.callThrough();
+
+      fixture.detectChanges();
+
+      expect(filterNonPoolDataSpy).toHaveBeenCalled();
+    });
   });
 });