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 { ToastrModule } from 'ngx-toastr';
8 import { configureTestBed, TabHelper } from '~/testing/unit-test-helper';
9 import { CoreModule } from '~/app/core/core.module';
10 import { Permissions } from '~/app/shared/models/permissions';
11 import { SharedModule } from '~/app/shared/shared.module';
12 import { CephModule } from '~/app/ceph/ceph.module';
13 import { CephSharedModule } from '~/app/ceph/shared/ceph-shared.module';
14 import { HostDetailsComponent } from './host-details.component';
16 describe('HostDetailsComponent', () => {
17 let component: HostDetailsComponent;
18 let fixture: ComponentFixture<HostDetailsComponent>;
22 BrowserAnimationsModule,
23 HttpClientTestingModule,
29 ToastrModule.forRoot()
34 fixture = TestBed.createComponent(HostDetailsComponent);
35 component = fixture.componentInstance;
36 component.selection = undefined;
37 component.permissions = new Permissions({
43 it('should create', () => {
44 expect(component).toBeTruthy();
47 describe('Host details tabset', () => {
49 component.selection = { hostname: 'localhost' };
50 fixture.detectChanges();
53 it('should recognize a tabset child', () => {
54 const tabsetChild = TabHelper.getNgbNav(fixture);
55 expect(tabsetChild).toBeDefined();
58 it('should show tabs', () => {
59 expect(TabHelper.getTextContents(fixture)).toEqual([
63 'Performance Details',