]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
d5480c7d6395176808c8662572f0b20ce33db5fe
[ceph.git] /
1 import { HttpClientTestingModule } from '@angular/common/http/testing';
2 import { ComponentFixture, TestBed } from '@angular/core/testing';
3
4 import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
5 import { CoreModule } from '../../../../core/core.module';
6 import { CdTableSelection } from '../../../../shared/models/cd-table-selection';
7 import { SharedModule } from '../../../../shared/shared.module';
8 import { CephModule } from '../../../ceph.module';
9 import { ServiceDetailsComponent } from './service-details.component';
10
11 describe('ServiceDetailsComponent', () => {
12   let component: ServiceDetailsComponent;
13   let fixture: ComponentFixture<ServiceDetailsComponent>;
14
15   configureTestBed({
16     imports: [HttpClientTestingModule, CephModule, CoreModule, SharedModule],
17     declarations: [],
18     providers: [i18nProviders]
19   });
20
21   beforeEach(() => {
22     fixture = TestBed.createComponent(ServiceDetailsComponent);
23     component = fixture.componentInstance;
24     component.selection = new CdTableSelection();
25     fixture.detectChanges();
26   });
27
28   it('should create', () => {
29     expect(component).toBeTruthy();
30   });
31
32   describe('Service details tabset', () => {
33     beforeEach(() => {
34       component.selection.selected = [{ serviceName: 'osd' }];
35       fixture.detectChanges();
36     });
37
38     it('should recognize a tabset child', () => {
39       const tabsetChild = component.tabsetChild;
40       expect(tabsetChild).toBeDefined();
41     });
42
43     it('should show tabs', () => {
44       expect(component.tabsetChild.tabs.map((t) => t.heading)).toEqual(['Daemons']);
45     });
46   });
47 });