]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / block / rbd-snapshot-list / rbd-snapshot-list.component.spec.ts
index 797fc35a11c6394a27a20b0b28784a3aa392d63e..1b9b3854665109dd580b1bb428b03dd3527c4728 100644 (file)
@@ -288,7 +288,7 @@ describe('RbdSnapshotListComponent', () => {
 
     it('should be disabled with version 1 and protected false', () => {
       const selection = new CdTableSelection([{ name: 'someName', is_protected: false }]);
-      const disableDesc = actions.getCloneDisableDesc(selection, ['layering']);
+      const disableDesc = actions.getCloneDisableDesc(selection);
       expect(disableDesc).toBe('Snapshot must be protected in order to clone.');
     });
 
@@ -299,8 +299,25 @@ describe('RbdSnapshotListComponent', () => {
     ])('should be enabled with version %d and protected %s', (version, is_protected) => {
       actions.cloneFormatVersion = version;
       const selection = new CdTableSelection([{ name: 'someName', is_protected: is_protected }]);
-      const disableDesc = actions.getCloneDisableDesc(selection, ['layering']);
+      const disableDesc = actions.getCloneDisableDesc(selection);
       expect(disableDesc).toBe(false);
     });
   });
+
+  describe('protect button disable state', () => {
+    let actions: RbdSnapshotActionsModel;
+
+    beforeEach(() => {
+      fixture.detectChanges();
+      const rbdService = TestBed.inject(RbdService);
+      const actionLabelsI18n = TestBed.inject(ActionLabelsI18n);
+      actions = new RbdSnapshotActionsModel(actionLabelsI18n, [], rbdService);
+    });
+
+    it('should be disabled if layering not supported', () => {
+      const selection = new CdTableSelection([{ name: 'someName', is_protected: false }]);
+      const disableDesc = actions.getProtectDisableDesc(selection, ['deep-flatten', 'fast-diff']);
+      expect(disableDesc).toBe('The layering feature needs to be enabled on parent image');
+    });
+  });
 });