]>
Commit | Line | Data |
---|---|---|
39ae355f | 1 | import { HttpClientTestingModule } from '@angular/common/http/testing'; |
11fdf7f2 TL |
2 | import { ComponentFixture, TestBed } from '@angular/core/testing'; |
3 | ||
f67539c2 TL |
4 | import { NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap'; |
5 | ||
6 | import { SharedModule } from '~/app/shared/shared.module'; | |
7 | import { configureTestBed } from '~/testing/unit-test-helper'; | |
11fdf7f2 TL |
8 | import { InfoGroupComponent } from './info-group.component'; |
9 | ||
10 | describe('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 | }); |