1 import { HttpClientTestingModule } from '@angular/common/http/testing';
2 import { ComponentFixture, TestBed } from '@angular/core/testing';
3 import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
4 import { RouterTestingModule } from '@angular/router/testing';
6 import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation';
7 import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
8 import { TabsModule } from 'ngx-bootstrap/tabs';
9 import { ToastrModule } from 'ngx-toastr';
11 import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
12 import { CoreModule } from '../../../../core/core.module';
13 import { Permissions } from '../../../../shared/models/permissions';
14 import { SharedModule } from '../../../../shared/shared.module';
15 import { CephModule } from '../../../ceph.module';
16 import { CephSharedModule } from '../../../shared/ceph-shared.module';
17 import { HostDetailsComponent } from './host-details.component';
19 describe('HostDetailsComponent', () => {
20 let component: HostDetailsComponent;
21 let fixture: ComponentFixture<HostDetailsComponent>;
25 BrowserAnimationsModule,
26 HttpClientTestingModule,
28 BsDropdownModule.forRoot(),
29 NgBootstrapFormValidationModule.forRoot(),
35 ToastrModule.forRoot()
38 providers: [i18nProviders]
42 fixture = TestBed.createComponent(HostDetailsComponent);
43 component = fixture.componentInstance;
44 component.selection = undefined;
45 component.permissions = new Permissions({
51 it('should create', () => {
52 expect(component).toBeTruthy();
55 describe('Host details tabset', () => {
57 component.selection = { hostname: 'localhost' };
58 fixture.detectChanges();
61 it('should recognize a tabset child', () => {
62 const tabsetChild = component.tabsetChild;
63 expect(tabsetChild).toBeDefined();
66 it('should show tabs', () => {
67 expect(component.tabsetChild.tabs.map((t) => t.heading)).toEqual([