import { async , TestBed } from '@angular/core/testing' ; import { BrowserAnimationsModule } from '@angular/platform-browser/animations' ; import { RouterTestingModule } from '@angular/router/testing' ; import { MaterialModule } from '@workshop/material' ; import { AppComponent } from './app.component' ; import { CoreDataModule } from '@workshop/core-data' ; describe ( 'AppComponent' , ( ) => { beforeEach ( async ( ( ) => { TestBed . configureTestingModule ( { imports : [ RouterTestingModule , MaterialModule , BrowserAnimationsModule ] , declarations : [ AppComponent ] } ) . compileComponents ( ) ; } ) ) ; it ( 'should create the app' , ( ) => { const fixture = TestBed . createComponent ( AppComponent ) ; const app = fixture . debugElement . componentInstance ; expect ( app ) . toBeTruthy ( ) ; } ) ; it ( `should have as title 'dashboard'` , ( ) => { const title = 'Angular Core Workshop' ; const fixture = TestBed . createComponent ( AppComponent ) ; const app = fixture . debugElement . componentInstance ; expect ( app . title ) . toEqual ( title ) ; } ) ; it ( 'should render title in the right element' , ( ) => { const title = 'Angular Core Workshop' ; const fixture = TestBed . createComponent ( AppComponent ) ; fixture . detectChanges ( ) ; const compiled = fixture . debugElement . nativeElement ; expect ( compiled . querySelector ( '.title' ) . textContent ) . toContain ( title ) ; } ) ; } ) ;