From: Afreen Misbah Date: Wed, 1 Jul 2026 10:51:00 +0000 (+0530) Subject: Merge pull request #68180 from rhcs-dashboard/bug-13712 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cfe12305fb1530d7163b687986f59e964c54d610;p=ceph.git Merge pull request #68180 from rhcs-dashboard/bug-13712 mgr/dashboard: Add option should be enabled even if allow all host access is enabled in nvme/tcp Reviewed-by: Afreen Misbah Reviewed-by: Abhishek Desai Reviewed-by: Dnyaneshwari Talwekar Reviewed-by: Sagar Gopale --- cfe12305fb1530d7163b687986f59e964c54d610 diff --cc src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-namespaces-list/nvmeof-namespaces-list.component.spec.ts index f64b74416b9,a259edf2bc4..f7f6b4261b1 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-namespaces-list/nvmeof-namespaces-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-namespaces-list/nvmeof-namespaces-list.component.spec.ts @@@ -62,13 -64,9 +65,14 @@@ describe('NvmeofNamespacesListComponent let fixture: ComponentFixture; let modalService: MockModalCdsService; + let nvmeofService: MockNvmeOfService; beforeEach(async () => { + const nvmeofStateServiceMock = { + refresh$: new Subject(), + requestRefresh: jest.fn() + }; + await TestBed.configureTestingModule({ declarations: [NvmeofNamespacesListComponent, NvmeofSubsystemsDetailsComponent], imports: [HttpClientModule, RouterTestingModule, SharedModule], diff --cc src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.spec.ts index f848d67c66e,3b061f2bf00..0acf8711376 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.spec.ts @@@ -158,6 -131,41 +158,41 @@@ describe('NvmeofSubsystemsComponent', ( }); it('should set first group as default initially', () => { - expect(component.group).toBe(mockGroups[0][0].spec.group); + expect(component.group).toBe('default'); }); + + it('should mark only current group as selected', () => { + component.group = 'foo'; + component.gwGroups = [{ content: 'default' }, { content: 'foo' }] as any; + + component.updateGroupSelectionState(); + + expect(component.gwGroups).toEqual([ + { content: 'default', selected: false }, + { content: 'foo', selected: true } + ]); + }); + + it('should clear selected group and refresh subsystem list', () => { + component.group = 'default'; + const getSubsystemsSpy = spyOn(component, 'getSubsystems'); + + component.onGroupClear(); + + expect(component.group).toBeNull(); + expect(getSubsystemsSpy).toHaveBeenCalled(); + }); + + it('should set error placeholder and prevent default on groups load error', () => { + const preventDefault = jasmine.createSpy('preventDefault'); + component.context = { error: jasmine.createSpy('error') } as any; + + component.handleGatewayGroupsError({ preventDefault }); + + expect(component.gwGroups).toEqual([]); + expect(component.gwGroupsEmpty).toBe(true); + expect(component.gwGroupPlaceholder).toBe('Unable to fetch Gateway groups'); + expect(preventDefault).toHaveBeenCalled(); + expect(component.context.error).toHaveBeenCalled(); + }); });