summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/info-group/info-group.component.spec.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/info-group/info-group.component.spec.ts')
-rw-r--r--src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/info-group/info-group.component.spec.ts35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/info-group/info-group.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/info-group/info-group.component.spec.ts
new file mode 100644
index 000000000..73ed55a8f
--- /dev/null
+++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/info-group/info-group.component.spec.ts
@@ -0,0 +1,35 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap';
+
+import { SharedModule } from '~/app/shared/shared.module';
+import { configureTestBed } from '~/testing/unit-test-helper';
+import { InfoGroupComponent } from './info-group.component';
+
+describe('InfoGroupComponent', () => {
+ let component: InfoGroupComponent;
+ let fixture: ComponentFixture<InfoGroupComponent>;
+
+ configureTestBed({
+ imports: [NgbPopoverModule, SharedModule],
+ declarations: [InfoGroupComponent]
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(InfoGroupComponent);
+ component = fixture.componentInstance;
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+
+ it('Setting groupTitle makes title visible', () => {
+ const groupTitle = 'Group Title';
+ component.groupTitle = groupTitle;
+ fixture.detectChanges();
+ const titleDiv = fixture.debugElement.nativeElement.querySelector('.info-group-title');
+
+ expect(titleDiv.textContent).toContain(groupTitle);
+ });
+});