blob: 73ed55a8fcf5474d14471182bef9c4e014192ad2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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);
});
});
|