]> git.proxmox.com Git - ceph.git/blame - 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
CommitLineData
11fdf7f2
TL
1import { HttpClientTestingModule } from '@angular/common/http/testing';
2import { ComponentFixture, TestBed } from '@angular/core/testing';
3
f67539c2 4import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
11fdf7f2 5
f67539c2 6import { PerformanceCounterModule } from '~/app/ceph/performance-counter/performance-counter.module';
522d829b 7import { RgwDaemon } from '~/app/ceph/rgw/models/rgw-daemon';
f67539c2
TL
8import { SharedModule } from '~/app/shared/shared.module';
9import { configureTestBed } from '~/testing/unit-test-helper';
11fdf7f2
TL
10import { RgwDaemonDetailsComponent } from './rgw-daemon-details.component';
11
12describe('RgwDaemonDetailsComponent', () => {
13 let component: RgwDaemonDetailsComponent;
14 let fixture: ComponentFixture<RgwDaemonDetailsComponent>;
15
16 configureTestBed({
17 declarations: [RgwDaemonDetailsComponent],
f67539c2 18 imports: [SharedModule, PerformanceCounterModule, HttpClientTestingModule, NgbNavModule]
11fdf7f2
TL
19 });
20
21 beforeEach(() => {
22 fixture = TestBed.createComponent(RgwDaemonDetailsComponent);
23 component = fixture.componentInstance;
e306af50 24 component.selection = undefined;
11fdf7f2
TL
25 fixture.detectChanges();
26 });
27
28 it('should create', () => {
29 expect(component).toBeTruthy();
30 });
522d829b
TL
31
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();
38
39 expect(component.serviceId).toBe(daemon.id);
40 expect(component.serviceMapId).toBe(daemon.service_map_id);
41 });
11fdf7f2 42});