]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-details/rgw-daemon-details.component.spec.ts
import ceph 16.2.6
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / rgw / rgw-daemon-details / rgw-daemon-details.component.spec.ts
index e9bebbe9aac955e61d5a5d91d64aca7a24b0e80e..40ea5a04328be18c873e967e77d8462eaf099ff2 100644 (file)
@@ -4,6 +4,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
 
 import { PerformanceCounterModule } from '~/app/ceph/performance-counter/performance-counter.module';
+import { RgwDaemon } from '~/app/ceph/rgw/models/rgw-daemon';
 import { SharedModule } from '~/app/shared/shared.module';
 import { configureTestBed } from '~/testing/unit-test-helper';
 import { RgwDaemonDetailsComponent } from './rgw-daemon-details.component';
@@ -27,4 +28,15 @@ describe('RgwDaemonDetailsComponent', () => {
   it('should create', () => {
     expect(component).toBeTruthy();
   });
+
+  it('should set service id and service map id on changes', () => {
+    const daemon = new RgwDaemon();
+    daemon.id = 'daemon1';
+    daemon.service_map_id = '4832';
+    component.selection = daemon;
+    component.ngOnChanges();
+
+    expect(component.serviceId).toBe(daemon.id);
+    expect(component.serviceMapId).toBe(daemon.service_map_id);
+  });
 });