]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #68180 from rhcs-dashboard/bug-13712
authorAfreen Misbah <afreen@ibm.com>
Wed, 1 Jul 2026 10:51:00 +0000 (16:21 +0530)
committerGitHub <noreply@github.com>
Wed, 1 Jul 2026 10:51:00 +0000 (16:21 +0530)
mgr/dashboard: Add option should be enabled even if allow all host access is enabled in nvme/tcp

Reviewed-by: Afreen Misbah <afreen@ibm.com>
Reviewed-by: Abhishek Desai <abhishek.desai1@ibm.com>
Reviewed-by: Dnyaneshwari Talwekar <dtalweka@redhat.com>
Reviewed-by: Sagar Gopale <sagar.gopale@ibm.com>
1  2 
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-namespaces-list/nvmeof-namespaces-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.spec.ts

index f64b74416b977b4c04d2d6a656c8a44182c12e40,a259edf2bc42aa9bc07b1e560db9156d8ec8e6aa..f7f6b4261b1168036038b42d1431d37c32d3ad54
@@@ -62,13 -64,9 +65,14 @@@ describe('NvmeofNamespacesListComponent
    let fixture: ComponentFixture<NvmeofNamespacesListComponent>;
  
    let modalService: MockModalCdsService;
+   let nvmeofService: MockNvmeOfService;
  
    beforeEach(async () => {
 +    const nvmeofStateServiceMock = {
 +      refresh$: new Subject<void>(),
 +      requestRefresh: jest.fn()
 +    };
 +
      await TestBed.configureTestingModule({
        declarations: [NvmeofNamespacesListComponent, NvmeofSubsystemsDetailsComponent],
        imports: [HttpClientModule, RouterTestingModule, SharedModule],
index f848d67c66ea32fa5b2083f150542a4dbe21ca52,3b061f2bf004693bbc70ea6474c92036be52cc56..0acf8711376c31c8dd524533711cc56ef7ddc290
@@@ -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();
+   });
  });