From: Afreen Misbah Date: Tue, 12 May 2026 20:16:56 +0000 (+0530) Subject: mgr/dashboard: Fix mon_allow_pool_delete unit test X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cc915db2269ef623fa54fe709a988e032d558b7d;p=ceph.git mgr/dashboard: Fix mon_allow_pool_delete unit test Signed-off-by: Afreen Misbah --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.spec.ts index 7f07dd94296f..bb1baff317c9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.spec.ts @@ -87,7 +87,8 @@ describe('PoolListComponent', () => { beforeEach(() => { configOptRead = true; spyOn(TestBed.inject(AuthStorageService), 'getPermissions').and.callFake(() => ({ - configOpt: { read: configOptRead } + configOpt: { read: configOptRead }, + pool: { read: true } })); configurationService = TestBed.inject(ConfigurationService); }); @@ -138,7 +139,7 @@ describe('PoolListComponent', () => { configOptRead = false; fixture = TestBed.createComponent(PoolListComponent); component = fixture.componentInstance; - expect(component.monAllowPoolDelete).toBe(false); + expect(component.monAllowPoolDelete).toBe(true); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts index 060d8644dd1f..1c773ab637f2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts @@ -113,7 +113,7 @@ export class PoolListComponent extends ListWithDetails implements OnInit { this.monAllowPoolDelete = monSection.value === 'true' ? true : false; } }); - } else if (this.permissions.pool.read) { + } else if (this.permissions.pool?.read) { /* `monAllowPoolDelete` will always be `false`, because no read permissions for reading config settings.