]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/info-group/info-group.component.spec.ts
import ceph quincy 17.2.6
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / dashboard / info-group / info-group.component.spec.ts
CommitLineData
39ae355f 1import { HttpClientTestingModule } from '@angular/common/http/testing';
11fdf7f2
TL
2import { ComponentFixture, TestBed } from '@angular/core/testing';
3
f67539c2
TL
4import { NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap';
5
6import { SharedModule } from '~/app/shared/shared.module';
7import { configureTestBed } from '~/testing/unit-test-helper';
11fdf7f2
TL
8import { InfoGroupComponent } from './info-group.component';
9
10describe('InfoGroupComponent', () => {
11 let component: InfoGroupComponent;
12 let fixture: ComponentFixture<InfoGroupComponent>;
13
14 configureTestBed({
39ae355f 15 imports: [NgbPopoverModule, SharedModule, HttpClientTestingModule],
11fdf7f2
TL
16 declarations: [InfoGroupComponent]
17 });
18
19 beforeEach(() => {
20 fixture = TestBed.createComponent(InfoGroupComponent);
21 component = fixture.componentInstance;
22 });
23
24 it('should create', () => {
25 expect(component).toBeTruthy();
26 });
27
28 it('Setting groupTitle makes title visible', () => {
29 const groupTitle = 'Group Title';
30 component.groupTitle = groupTitle;
31 fixture.detectChanges();
32 const titleDiv = fixture.debugElement.nativeElement.querySelector('.info-group-title');
33
34 expect(titleDiv.textContent).toContain(groupTitle);
35 });
36});