import { async , ComponentFixture , TestBed } from '@angular/core/testing' ; import { FormsModule , ReactiveFormsModule } from '@angular/forms' ; import { RouterTestingModule } from '@angular/router/testing' ; import { ExportComponent } from './export.component' ; import { ParseDescriptionService } from '../services/parse-description.service' ; import { DatabaseService } from '../services/database.service' ; import { StatusMessageService } from '../services/status-message.service' ; import { CoverLetterService } from '../services/cover-letter.service' ; describe ( 'ExportComponent' , ( ) => { let component ; let fixture ; beforeEach ( async ( ( ) => { TestBed . configureTestingModule ( { declarations : [ ExportComponent ] , imports : [ FormsModule , ReactiveFormsModule , RouterTestingModule . withRoutes ( [ ] ) ] , providers : [ ParseDescriptionService , StatusMessageService , CoverLetterService , DatabaseService ] } ) . compileComponents ( ) ; } ) ) ; beforeEach ( ( ) => { fixture = TestBed . createComponent ( ExportComponent ) ; component = fixture . componentInstance ; fixture . detectChanges ( ) ; } ) ; it ( 'should create' , ( ) => { expect ( component ) . toBeTruthy ( ) ; } ) ; it ( 'should render "Exported Cover Letter:" in an h4' , async ( ( ) => { const compiled = fixture . debugElement . nativeElement ; expect ( compiled . querySelector ( '#export-title' ) . textContent ) . toContain ( 'Exported Cover Letter' ) ; } ) ) ; } ) ;