1 import { HttpClientTestingModule } from '@angular/common/http/testing';
2 import { ComponentFixture, TestBed } from '@angular/core/testing';
4 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
6 import { PerformanceCounterModule } from '~/app/ceph/performance-counter/performance-counter.module';
7 import { RgwDaemon } from '~/app/ceph/rgw/models/rgw-daemon';
8 import { SharedModule } from '~/app/shared/shared.module';
9 import { configureTestBed } from '~/testing/unit-test-helper';
10 import { RgwDaemonDetailsComponent } from './rgw-daemon-details.component';
12 describe('RgwDaemonDetailsComponent', () => {
13 let component: RgwDaemonDetailsComponent;
14 let fixture: ComponentFixture<RgwDaemonDetailsComponent>;
17 declarations: [RgwDaemonDetailsComponent],
18 imports: [SharedModule, PerformanceCounterModule, HttpClientTestingModule, NgbNavModule]
22 fixture = TestBed.createComponent(RgwDaemonDetailsComponent);
23 component = fixture.componentInstance;
24 component.selection = undefined;
25 fixture.detectChanges();
28 it('should create', () => {
29 expect(component).toBeTruthy();
32 it('should set service id and service map id on changes', () => {
33 const daemon = new RgwDaemon();
34 daemon.id = 'daemon1';
35 daemon.service_map_id = '4832';
36 component.selection = daemon;
37 component.ngOnChanges();
39 expect(component.serviceId).toBe(daemon.id);
40 expect(component.serviceMapId).toBe(daemon.service_map_id);