1 import { HttpClientTestingModule } from '@angular/common/http/testing';
2 import { ComponentFixture, TestBed } from '@angular/core/testing';
3 import { FormsModule } from '@angular/forms';
4 import { By } from '@angular/platform-browser';
5 import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
6 import { RouterTestingModule } from '@angular/router/testing';
8 import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
10 import { SharedModule } from '~/app/shared/shared.module';
11 import { configureTestBed } from '~/testing/unit-test-helper';
12 import { ConfigurationDetailsComponent } from './configuration-details/configuration-details.component';
13 import { ConfigurationComponent } from './configuration.component';
14 import { TableComponent } from '~/app/shared/datatable/table/table.component';
16 describe('ConfigurationComponent', () => {
17 let component: ConfigurationComponent;
18 let fixture: ComponentFixture<ConfigurationComponent>;
21 declarations: [ConfigurationComponent, ConfigurationDetailsComponent, TableComponent],
23 BrowserAnimationsModule,
27 HttpClientTestingModule,
33 fixture = TestBed.createComponent(ConfigurationComponent);
34 component = fixture.componentInstance;
35 fixture.detectChanges();
38 it('should create', () => {
39 expect(component).toBeTruthy();
42 it('should check header text', () => {
43 const cdTableEl = fixture.debugElement.query(By.directive(TableComponent));
44 const cdTableComponent: TableComponent = cdTableEl.componentInstance;
45 cdTableComponent.ngAfterViewInit();
46 fixture.detectChanges();
47 const actual = fixture.debugElement.query(By.css('thead')).nativeElement.textContent.trim();
48 const expected = 'Name Description Current value Default Editable';
49 expect(actual).toBe(expected);