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